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
import Html | |
type TreeF v a | |
= Node v (List a) | |
treeMap : (a -> b) -> TreeF v a -> TreeF v b | |
treeMap f (Node v xs) = | |
Node v <| List.map f xs |
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
import Html exposing (text) | |
type NodeF v a | |
= Empty v | |
| Elem (List a) | |
nodeMap : (a -> b) -> NodeF v a -> NodeF v b | |
nodeMap f node = | |
case node of | |
Empty v -> Empty v |