Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Real World PureScript

Real World PureScript

This is a workshop I gave at Monadic Party in Poznan. See the source materials here: https://github.com/justinwoo/real-world-purescript-workshop-2019

Justin Woo

June 21, 2019
Tweet

More Decks by Justin Woo

Other Decks in Programming

Transcript

  1. Records --fromPrim("builtins") dataRecord::#Type->Type typeMyRecordA= {apple::String ,banana::String } typeMyRecordB= Record (apple::String

    ,banana::String ) id=identity::MyRecordA->MyRecordB fn1::MyRecordA->String fn1r=r.apple fn1::MyRecordA->MyRecordA fn1r=r{apple="no"} 15/21
  2. Humor "FunTypeLevelliteralnumberarithmeticwithInstanceChains"https://github.com/justinwoo/my- blog-posts/blob/master/posts/2018-05-27-fun-type-level-literal-number-arithmetic-with-instance- chains.md classAdd(l::Symbol)(r::Symbol)(o::Symbol)|l->ro instancezeroAdd::Add"zero"rr elseinstancesuccAdd:: (Succl'l ,Succrr' ,Addl'r'o

    )=>Addlro "Wedon'tneedPeanoNumbersinPureScript"https://github.com/justinwoo/my-blog- posts/blob/master/posts/2018-09-11-we-dont-need-peano-numbers-in-purescript.md resultSub2::SProxy"....................................." resultSub2= T.sub(SProxy::SProxy"...............................................")(SProxy::SProxyT.Ten) 20/21