Re: [Haskell-cafe] Type families not as useful over functions

2009-02-12 Thread Miguel Mitrofanov
What do you need that for? Can you live with infixl |$| (|$|) :: [a - r] - a - [r] fs |$| x = map ($ x) fs and, instead of broadcast fs a b use fs |$| a |$| b ? On 13 Feb 2009, at 02:34, John Ky wrote: Hi Haskell Cafe, I tried using type families over functions, but when I try it

Re: [Haskell-cafe] Type families not as useful over functions

2009-02-12 Thread Jonathan Cast
On Fri, 2009-02-13 at 10:34 +1100, John Ky wrote: Hi Haskell Cafe, I tried using type families over functions, but when I try it complains that the two lines marked conflict with each other. class Broadcast a where type Return a broadcast :: a - Return a instance Broadcast [a -

Re: [Haskell-cafe] Type families not as useful over functions

2009-02-12 Thread John Ky
Hi Miguel, That's a nice way of writing it. Thanks, -John On Fri, Feb 13, 2009 at 10:42 AM, Miguel Mitrofanov miguelim...@yandex.ruwrote: What do you need that for? Can you live with infixl |$| (|$|) :: [a - r] - a - [r] fs |$| x = map ($ x) fs and, instead of broadcast fs a b use

Re: [Haskell-cafe] Type families not as useful over functions

2009-02-12 Thread John Ky
Hi Johnaton, Ah yes. That makes sense. Is there a way to define type r to be all types except functions? -John On Fri, Feb 13, 2009 at 10:44 AM, Jonathan Cast jonathancc...@fastmail.fmwrote: On Fri, 2009-02-13 at 10:34 +1100, John Ky wrote: Hi Haskell Cafe, I tried using type families

Re: [Haskell-cafe] Type families not as useful over functions

2009-02-12 Thread Jonathan Cast
On Fri, 2009-02-13 at 11:15 +1100, John Ky wrote: Hi Johnaton, Ah yes. That makes sense. Is there a way to define type r to be all types except functions? Not without overlapping instances. I *think* if you turn on {-# LANGUAGE OverlappingInstances #-} then instance Broadcast r where

Re: [Haskell-cafe] Type families not as useful over functions

2009-02-12 Thread George Pollard
Can you live with infixl |$| (|$|) :: [a - r] - a - [r] fs |$| x = map ($ x) fs and, instead of broadcast fs a b use fs |$| a |$| b ? map ($ x) fs = { Applicative Functors satisfy... } pure ($ x) * fs = { 'interchange' rule from Control.Applicative } fs * pure x Thus;