Is a a way to do a “Bare” state monad in modern Haskell?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is a a way to do a “Bare” state monad in modern Haskell?

Carter Schonwald
1) we have a monad instance for (r -> )

2) is there some way we can arrange sans newtype an instance for its state monad sibling ( /\ x . s-> (s,x)) without a type lambda or some new type or injective type families?  I can definitely see that this is def not possible with h98-h2010, is this otherwise expressible?

Mostly just curious if there’s some trick that’s now possible :)

_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Is a a way to do a “Bare” state monad in modern Haskell?

Henning Thielemann

On Sat, 22 Feb 2020, Carter Schonwald wrote:

> 1) we have a monad instance for (r -> )

And a duplicate Writer monad for (,) w.

> 2) is there some way we can arrange sans newtype an instance for its
> state monad sibling ( /\ x . s-> (s,x)) without a type lambda or some
> new type or injective type families?  I can definitely see that this is
> def not possible with h98-h2010, is this otherwise expressible?

Why should one want this?
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries