Skip to content

Instantly share code, notes, and snippets.

@Risto-Stevcev
Created September 25, 2017 12:42
Show Gist options
  • Save Risto-Stevcev/57ac0902259e4f409702f3e82735ad4b to your computer and use it in GitHub Desktop.
Save Risto-Stevcev/57ac0902259e4f409702f3e82735ad4b to your computer and use it in GitHub Desktop.
Some initial experimentation with finally tagless sums for JS primitives in Purescript
module Primitive (class Primitive) where
class OnlyPrimitive a
instance intOnlyPrimitive ∷ OnlyPrimitive Int
instance boolOnlyPrimitive ∷ OnlyPrimitive Boolean
instance stringOnlyPrimitive ∷ OnlyPrimitive String
class OnlyPrimitive a ⇐ Primitive a
instance intPrimitive ∷ Primitive Int
instance boolPrimitive ∷ Primitive Boolean
instance stringPrimitive ∷ Primitive String
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment