Opened 3 years ago

Closed 2 years ago

#389 closed defect (fixed)

Fix parsing of local recursive functions in 'do' syntax.

Reported by: benl Owned by:
Priority: normal Milestone: 0.4.3
Component: Source Parser Version: 0.4.2
Keywords: Cc:


This looks clunky. Maybe allow 'do' syntax with a 'rec' keyword like with the monadfix extension of Haskell.

extend r using r' with { Alloc r'; Read r'; Write r'} in
   let  world'  = run newWorld [r'] width height in

   let  go (x y: Nat): S (Read r + Read r' + Write r' + Alloc r') Unit
         | x >= width   = go 0 (y + 1)
         | y >= height  = ()
         | otherwise    
          = do  setCell world' x y (f x y)
                go (x + 1) y
   in do 
        go 0 0

Change History (2)

comment:1 Changed 3 years ago by benl

  • Component changed from Unknown to Source Parser

comment:2 Changed 2 years ago by benl

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