functional programming - Purescript applicative does not execute -


this executes:

main =    ctx <- getcanvaselementbyid "stage" >>= getcontext2d   bs  <- initbranches   tick 0 ctx bs 

but not:

main = tick 0 <$> (getcanvaselementbyid "stage" >>= getcontext2d)               <*> initbranches 

however both compile, , understanding both mean same basic thing. why case? can use applicative syntax here (its more understandable imho)


this works

main =   <- (tick 0) <$> (getcanvaselementbyid "stage" >>= getcontext2d) <*> initbranches    b <-   fprint b 

main = join $ tick 0 <$> (getcanvaselementbyid "stage" >>= getcontext2d)                       <*> initbranches  

the applicative creates nested eff, join resolves easily


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -