ehrenmurdick/purescript-oak

Using existing `State` monad rather than manually re-implemented `Builder`

suzumiyasmith opened this issue · 2 comments

Code base should be minified based on the idea that do not implement stander library

In short,

data T a b
  = T a b

data Builder st a
  = Builder (st -> (T a st))

is exactly the same thing defined in (https://pursuit.purescript.org/packages/purescript-transformers/4.2.0/docs/Control.Monad.State). And over 20 lines code is about re-implementing it.

Import Control.Monad.State and Data.Tuple
putBuilder is put;
getBuilder is get;
runBuilder is reverse <<< execState.

Thank you!