haskell - Is it possible to use irrefutable tilde (`~`) patterns in lambda expressions? -


The GHC gives me a parse error on the input <~ if I type the pattern of lambda expression to tilde As I can do the designated work

  step = \ ~ (X, S) -> gt; Run (fx) s - pars error ~ (x, s) = run (fx) s - works fine    

You have to add a location between Lambda and Tilde

  \ ~ (x, s) - & gt; The source of confusion is because the  \  and  ~  are both valid characters for the user defined operator, so  << code>  

code> \ ~ is parsed as the beginning of the lambda expression instead of being parsed:

  - Define the definition of a custom operator is allowed: a \ ~ B = {- ... -}    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -