> data X a b = X a b> instance Functor (X a) where
> fmap f (X a b) = X a (f b)
Yeah, that works just fine.
On Fri, Jul 17, 2009 at 1:14 PM, Petr Pudlak wrote:
> Hi, I have probably a very simple question, but I wasn't able to figure it
> out
> myself.
>
> Consider a two-parameter data type
Obviously `mappend` is good enough as it is.
Choosing (+>) or (<>) are just for prettifying code.
Generalizing (++) not only makes the code prettier, but also brings Monoid
into the Prelude.
You can either Do It Right(tm), or be conservative and try to maintain
backwards compatibility as much as
I think I can see the point of forcing a list without forcing the actual
data, but is there a way to do this that works on circular lists as well?
On Mon, Jun 29, 2009 at 3:30 AM, Ketil Malde wrote:
> Deniz Dogan writes:
>
> > What is the spine of a list? Google seems to fail me on this one.
>
The linked paper appears to show the right style.
This appears to satisfy the conditions, however:
inTwain as = let (x,y,_) = foldr (\a (r,s,t) -> case (t) of {b:(b':bs) ->
(r,a:s,bs); _ -> (a:r,s,t)}) ([],[],as) as in (x,y)
In the case of a list of odd length, the first half is given the extra
e