Skip to content

Instantly share code, notes, and snippets.

@mbloms
Last active January 10, 2018 13:58
Show Gist options
  • Save mbloms/fe49ad5d829596294f4f86d29ccb936e to your computer and use it in GitHub Desktop.
Save mbloms/fe49ad5d829596294f4f86d29ccb936e to your computer and use it in GitHub Desktop.
Partial Types in Haskell. Concept
cond [a] {Infinite} :-
[a] {a : [a] {Infinite}}
cond [a] {NonEmpty} :-
[a] {a : [a]}
cond Maybe a {NonEmpty} :-
Just a
newtype Stream a = Stream ([a] {Infinite})
data Finger a =
One a
Two a a
Three a a a
Four a a a a
newtype Node23 a = Node (Finger a {Two a a | Three a a a})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment