Opened 11 months ago

Closed 9 months ago

#7935 closed feature request (invalid)

Syntactic sugar for comonads

Reported by: wvv Owned by:
Priority: normal Milestone:
Component: Compiler Version:
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

It could be useful to have this as extension.

More details:
http://www.haskellforall.com/2013/02/you-could-have-invented-comonads.html
chapter
"Syntactic sugar for comonads"

method
    wa> expr1
    wb> expr2
    wc> expr3

= -- this desugars to:

   \wa ->
let wb =      extend (\this -> expr1) wa
    wc =      extend (\this -> expr2) wb
 in extract $ extend (\this -> expr3) wc

and

method
    expr1
    expr2
    expr3
=
   \_wa ->
let _wb =      extend (\this -> expr1) _wa
    _wc =      extend (\this -> expr2) _wb
in  extract  $ extend (\this -> expr3) _wc

Change History (1)

comment:1 Changed 9 months ago by carter

  • Difficulty set to Unknown
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.