Skip to content

Instantly share code, notes, and snippets.

@afcondon
Created August 17, 2016 15:39
Show Gist options
  • Save afcondon/3084630a15d711dcab79da7bddea3b65 to your computer and use it in GitHub Desktop.
Save afcondon/3084630a15d711dcab79da7bddea3b65 to your computer and use it in GitHub Desktop.
Ord-ering sum types
module Main where
import Prelude
import Control.Monad.Eff.Console
newtype A = A Int
data Foo = Foo | Bar | Baz
derive instance eqFoo :: Eq Foo
derive instance ordFoo :: Ord Foo
derive instance eqA :: Eq A
derive instance ordA :: Ord A
main = do
logShow $ A 1 > A 2
logShow $ max Foo Bar == Foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment