Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-07 Thread Peter Berry
On Mon, Apr 6, 2009 at 7:39 PM, Manuel M T Chakravarty wrote: > Peter Berry: > >> 3) we apply appl to x, so Memo d1 a = Memo d a. unify d = d1 >> >> But for some reason, step 3 fails. > > Step 3 is invalid - cf, > <http://www.haskell.org/pipermail/haskell-caf

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-07 Thread Peter Berry
On 07/04/2009, Ryan Ingram wrote: > On Mon, Apr 6, 2009 at 2:36 PM, Peter Berry wrote: >> As I understand it, the type checker's thought process should be along >> these lines: >> >> 1) the type signature dictates that x has type Memo d a. >> 2) appl has

[Haskell-cafe] Strange type error with associated type synonyms

2009-04-06 Thread Peter Berry
rect type (using scoped type variables), it type checks: > -- thanks to mmorrow on #haskell for this > memo_fmap'' :: forall a b d. Fun d => (a -> b) -> Memo d a -> Memo d b > memo_fmap'' f x = abst (f . (appl :: Memo d

Re: [Haskell-cafe] Re: Memoization

2007-06-08 Thread Peter Berry
On 08/06/07, Peter Berry <[EMAIL PROTECTED]> wrote: You could generate F and the Memoizable instance using TH or DrIFT or the like (allowing derivation would be really nice :). Actually F could be considered a dependent type, so you could define a pretty much universal instance using T

Re: [Haskell-cafe] Re: Memoization

2007-06-08 Thread Peter Berry
Memo functions, polytypically! http://www.informatik.uni-bonn.de/~ralf/publications.html#P11 and R. Hinze. Generalizing generalized tries. http://www.informatik.uni-bonn.de/~ralf/publications.html#J4 also: T. Altenkirch. Representations of first order function types as terminal coalgebra

Re: [Haskell-cafe] type inference futility

2007-04-16 Thread Peter Berry
t, i.e. tell the compiler exactly which type you want. The report seems to suggest you can give the compiler a list of defaults in the module declaration but I don't know if that would be sensible. -- Peter Berry <[EMAIL PROTECTED]> Please avoid sending me Word or PowerPoint attachments. S

Fwd: [Haskell-cafe] Optimization fun

2007-02-10 Thread Peter Berry
since there are infinitely many of them?) -- Peter Berry <[EMAIL PROTECTED]> Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Fwd: [Haskell-cafe] Newbie: generating a truth table

2007-02-10 Thread Peter Berry
he Enum and Bounded type classes, which define, respectively, * enumFrom and enumFromTo (which have syntactic sugar in [foo..] and [foo..bar] respectively), and * minBound and maxBound. You can do the same with any instance of these classes. -- Peter Berry <[EMAIL PROTECTED]> Please avoid s

Re: [Haskell-cafe] Currying

2007-01-18 Thread Peter Berry
: add x y = x + y map (add 2) [1..5] Don't know if you know this, but infix operators like (+) are functions too, and you can partially apply them using 'sections': map (+2) [1..5] It's only syntax, but this is one of the things I really like about Haskell. -- Peter Berry &

[Haskell-cafe] Haskell category (was: Article review: Category Theory)

2007-01-16 Thread Peter Berry
ject involves defining the semantics of a memoization function in Haskell using category theory, so of course I've been trying to figure out exactly what the Haskell category consists of. I've put a summary of my thoughts at http://sucs.org/~pwb/cats.txt . I'd appreciate comments