-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Description
Maybe this is a bit pedantic but the functions like foldJson
are not really folds since they only inspect one layer of the structure, whereas folds deeply traverse a structure.
I was a bit confused in trying out this library by this naming.
I would expect foldJson
to have the type
foldJson :: forall a.
(JNull -> a) -> (JBoolean -> a) -> (JNumber -> a) ->
(JString -> a) -> (Array a -> a) -> (StrMap a -> a) ->
Json -> a
which of course you can implement using the current foldJson
and recursion.
It's probably too much of a pain, but it seems to me like all the things currently called foldFoo
should be caseFoo
.
Metadata
Metadata
Assignees
Labels
No labels