Skip to content

Instantly share code, notes, and snippets.

@gabejohnson
Last active June 4, 2020 03:26
Show Gist options
  • Save gabejohnson/a3f058f888dd4d6e4826b4296028d40e to your computer and use it in GitHub Desktop.
Save gabejohnson/a3f058f888dd4d6e4826b4296028d40e to your computer and use it in GitHub Desktop.
Record shenanigans
module Main where
import Prelude
import Record.Unsafe (unsafeDelete)
import Effect (Effect)
import TryPureScript (h1, text, render)
r :: forall t. Record (x :: Boolean, x :: Int, x :: String, x :: t)
r = { x: [3] } { x = true }
r2 :: forall t. Record (x :: Boolean, x :: Int, x :: String, x :: t)
r2 = unsafeDelete "x" r
main :: Effect Unit
main =
render $ h1 (text $ show r2.x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment