On Oct 20, 2011, at 5:09 PM, Sam Tobin-Hochstadt wrote:
>
> Unfortunately, Typed Racket doesn't support higher-kinded type
> parameters, which is what you would need here.
That's what we thought/feared.
> If you have an example of how you want to use this where the solution
> I gave earlier does
On Thu, Oct 20, 2011 at 2:52 PM, Eric Tanter wrote:
> Thanks Sam,
>
> Actually, that's not what we're after.
>
> In untyped Racket, we have a struct monad:
>
> (struct monad
> (;; A -> M A
> return
> ;; A -> (A -> M B) -> M B
> bind))
>
> Then we have several instantiations (exception, stat
On 10/20/2011 01:27 PM, Jay McCarthy wrote:
On Thu, Oct 20, 2011 at 12:52 PM, Eric Tanter wrote:
Thanks Sam,
Actually, that's not what we're after.
In untyped Racket, we have a struct monad:
(struct monad
(;; A -> M A
return
;; A -> (A -> M B) -> M B
bind))
Then we have sever
On Thu, Oct 20, 2011 at 12:52 PM, Eric Tanter wrote:
> Thanks Sam,
>
> Actually, that's not what we're after.
>
> In untyped Racket, we have a struct monad:
>
> (struct monad
> (;; A -> M A
> return
> ;; A -> (A -> M B) -> M B
> bind))
>
> Then we have several instantiations (exception, sta
Thanks Sam,
Actually, that's not what we're after.
In untyped Racket, we have a struct monad:
(struct monad
(;; A -> M A
return
;; A -> (A -> M B) -> M B
bind))
Then we have several instantiations (exception, state, what-have-you):
(define my-fancy-monad (monad (lambda ...) (lambda .
On Thu, Oct 20, 2011 at 10:45 AM, Eric Tanter wrote:
> Hi,
>
> Is there a way to type a monad?
>
> For example in OCaml:
>
> module type MonadRequirements = sig
> type ‘a t
> val bind : ‘a t -> (‘a -> ‘b t) -> ‘b t
> val return : ‘a -> ‘a t
> end;;
>
> In Typed Racket we can use a polymor
Hi,
Is there a way to type a monad?
For example in OCaml:
module type MonadRequirements = sig
type ‘a t
val bind : ‘a t -> (‘a -> ‘b t) -> ‘b t
val return : ‘a -> ‘a t
end;;
In Typed Racket we can use a polymorphic struct to have the parametrization by
'a and 'b, but is it possible
7 matches
Mail list logo