Skip to content

Instantly share code, notes, and snippets.

@jmatsushita
Created July 1, 2020 16:24
Show Gist options
  • Save jmatsushita/404eefaba98d2e42c16fcd333487ce8b to your computer and use it in GitHub Desktop.
Save jmatsushita/404eefaba98d2e42c16fcd333487ce8b to your computer and use it in GitHub Desktop.
module Main where
import Prelude
import Effect (Effect)
import Data.Foldable (fold)
import TryPureScript (h1, text, render)
data Nat m n = Nat (m ~> n)
data NatR m n = NatR { nat :: (m ~> n) }
use :: forall m n. Nat m n -> m Unit -> n Unit
use (Nat nat) = nat
useR :: forall m n. NatR m n -> m Unit -> n Unit
useR (NatR { nat }) = nat
main :: Effect Unit
main =
render $ fold
[ h1 (text "Try natural transformation in records!")
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment