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
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
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
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
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
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
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
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
:
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 &
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
10 matches
Mail list logo