Skip to content

Instantly share code, notes, and snippets.

@kossnocorp
Last active May 4, 2016 15:31
Show Gist options
  • Save kossnocorp/d5c4c36965805fe0dbed7d78c4935ed1 to your computer and use it in GitHub Desktop.
Save kossnocorp/d5c4c36965805fe0dbed7d78c4935ed1 to your computer and use it in GitHub Desktop.
module Reverse (..) where
import Html exposing (Html, text)
import String
reverse : List Char -> List Char
reverse str =
case str of
[] ->
[]
head :: tail ->
List.append [ head ] (reverse tail)
main : Html
main =
[ 'h', 'e', 'l', 'l', 'o' ]
|> List.foldl String.cons ""
|> text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment