Last active
May 4, 2016 15:31
-
-
Save kossnocorp/d5c4c36965805fe0dbed7d78c4935ed1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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