default.txt 497 B

1234567891011121314151617181920212223
  1. module Examples.Hello (main, Point, Tree(..)) where
  2. import Html exposing (Html, span, text)
  3. import Html.Attributes exposing (..)
  4. import Time
  5. main : Html
  6. main =
  7. span [class "welcome-message"] [text "Hello, World!"]
  8. type alias Point = { x : Int, y : Int }
  9. type Tree a = Leaf a | Node (Tree a) a (Tree a)
  10. flatten : Tree a -> List a
  11. flatten t =
  12. case t of
  13. Leaf a -> [a]
  14. Node l a r -> flatten l ++ a :: flatten r
  15. -- outgoing values
  16. port time : Signal Float
  17. port time = Time.every 1000