Paramorphs
  Home FAQ Contact Sign in
 
Advanced search
MATCHING GROUPS



more...
POPULAR GROUPS

more...

found 12 articles for 0.302 sec
--------------------------------------------------------------------------- Haskell Weekly News http://sequence.complete.org/hwn/20080625 Issue 74 - June 25, 2008 --------------------------------------------------------------------------- Welcome to issue 74 of HWN, a newsletter covering developments in the [1]Haskell community. This week, you'll notice a bit more detail in the     

Group: fa.haskell · Group Profile · Search for Paramorphs in fa.haskell
Author: Brent Yorgey
Date: Jun 25, 2008 14:11

That's simple Tom. Imagine the factorial function for Int written as a paramorphism: type instance F Int = Either One instance (Mu Int) where inn (Left _) = 0 inn (Right n) = succ n out 0 = Left () out n = Right (pred n) instance Functor (F Int) where fmap _ (Left ()) = Left () fmap f (Right n) = Right (f n) fact :: Int -> Int fact = para (const 1 \/ (uncurry
Show full article (16.40Kb)
On Tue, 11 Mar 2008, Hugo Pacheco wrote: > Yes, I have tried both implementations at the start and solved it by > choosing for the following: > type family F a :: * -> * > type FList a x = Either () (a,x) > type instance F [a] = FList a > > instance (Functor (F [a])) where > fmap _ (Left _) = Left () > fmap f (Right (a,x)) = Right (a,f x) For this implementation we do have that F     

Group: fa.haskell · Group Profile · Search for Paramorphs in fa.haskell
Author: Hugo Pacheco
Date: Mar 12, 2008 02:28

Yes, I have tried both implementations at the start and solved it by choosing for the following: type family F a :: * -> * type FList a x = Either () (a,x) type instance F [a] = FList a instance (Functor (F [a])) where fmap _ (Left _) = Left () fmap f (Right (a,x)) = Right (a,f x) The option was: type family F a x :: * type instance F [a] x = Either() (a,x) instance (Functor (F
Show full article (1.03Kb) · Show article thread
unflead jacobaean masoner professionalize dysprosia Levisticum unpolymerized unslippered coplot condylomatous slipperweed contango trashily undertakery Mercatorial eternalized agapanthus ancestrally unprejudice schedulers cubitoplantar attainably lankly before-warned vitochemic shelled viage Trotskyite intraclitelline hemistichal extraregularly impectinate big-antlered Suttapitaka refracts subterfluous     

Group: fa.haskell · Group Profile · Search for Paramorphs in fa.haskell
Author: Tom Schrijvers
Date: Mar 12, 2008 00:56

unflead jacobaean masoner professionalize dysprosia Levisticum unpolymerized unslippered coplot condylomatous slipperweed contango trashily undertakery Mercatorial eternalized agapanthus ancestrally unprejudice schedulers cubitoplantar attainably lankly before-warned vitochemic shelled viage Trotskyite intraclitelline hemistichal extraregularly impectinate big-antlered Suttapitaka refracts subterfluous
Show full article (2.41Kb) · Show article thread
Sure, but we also have para f e xs = snd $ foldr (\ x ~(xs, y) -> (x:xs, f x xs y)) ([], e) xs So I think using para is fine. -- Lennart On Feb 12, 2007, at 18:40 , Bernie Pope wrote: > Nicolas Frisby wrote: >> Guess this is a tricky choice for a foldr intro, since it requires a >> "paramorphism" (see bananas lenses wires etc.) >> >> para :: (a -> [a] -> b -> b) -> b -> [a] -> b     

Group: fa.haskell · Group Profile · Search for Paramorphs in fa.haskell
Author: Hugo Pacheco
Date: Mar 11, 2008 21:55

Oops; I totally forgot the context of this whole discussion! I enjoyed your article. On 2/12/07, Bernie Pope <bjpop@csse.unimelb.edu.au> wrote: Nicolas Frisby wrote: Guess this is a tricky choice for a foldr intro, since it requires a "paramorphism" (see bananas lenses wires etc.) para :: (a -> [a] -> b -> b) -> b -> [a] -> b para f e [] = e para f e (x:xs) =
Show full article (1.81Kb) · Show article thread
Nicolas Frisby wrote: > Guess this is a tricky choice for a foldr intro, since it requires a > "paramorphism" (see bananas lenses wires etc.) > > para :: (a -> [a] -> b -> b) -> b -> [a] -> b > para f e [] = e > para f e (x:xs) = f x xs (para f e xs) > > -- note that the original tail of the list (i.e. xs and not xs') is > used in the else-branch > dropWhile' p = para (\x xs xs' -> if p x     

Group: alt.prisons · Group Profile · Search for Paramorphs in alt.prisons
Author: _ G O D _
Date: Oct 30, 2007 21:02

Guess this is a tricky choice for a foldr intro, since it requires a "paramorphism" (see bananas lenses wires etc.) para :: (a -> [a] -> b -> b) -> b -> [a] -> b para f e [] = e para f e (x:xs) = f x xs (para f e xs) -- note that the original tail of the list (i.e. xs and not xs') is used in the else-branch dropWhile' p = para (\x xs xs' -> if p x then xs' else (x:xs)) [] Prelude> dropWhile'
Show full article (16.20Kb) · Show article thread
    

Group: alt.activism.deathpenalty · Group Profile · Search for Paramorphs in alt.activism.deathpenalty
Author: _ G O D _
Date: Oct 30, 2007 21:02

Show full article (16.20Kb)
    

Group: fa.haskell · Group Profile · Search for Paramorphs in fa.haskell
Author: Lennart Augustsson
Date: Feb 12, 2007 11:41

Show full article (1.07Kb)
    

Group: fa.haskell · Group Profile · Search for Paramorphs in fa.haskell
Author: Nicolas Frisby
Date: Feb 12, 2007 11:37

Show full article (0.87Kb)
    

Group: fa.haskell · Group Profile · Search for Paramorphs in fa.haskell
Author: Bernie Pope
Date: Feb 12, 2007 10:40

Show full article (0.69Kb) · Show article thread
    

Group: fa.haskell · Group Profile · Search for Paramorphs in fa.haskell
Author: Nicolas Frisby
Date: Feb 12, 2007 07:35

Show full article (1.59Kb)
1 · 2 · next