Re: [Haskell-cafe] arr considered harmful

2012-12-21 Thread Conal Elliott
Oh, I see Ross's trick. By quantifying over the domain range types, they can later be specialized to analysis-time types (like circuit labels) or to run-time types (like Boolean or Integer). On Thu, Dec 20, 2012 at 4:55 PM, Conal Elliott co...@conal.net wrote: If you require the circuit to be

Re: [Haskell-cafe] monoid pair of monoids?

2012-12-21 Thread Christopher Howard
On 12/20/2012 08:54 PM, Daniel Feltey wrote: You were only missing the restriction that both types a and b must be instances of Monoid in order to make Socket a b into an instance of Monoid. Dan Feltey Thank you for your help. An additional question, if I might: For the sake of elegance

Re: [Haskell-cafe] category design approach for inconvenient concepts

2012-12-21 Thread Oleksandr Manzyuk
On Fri, Dec 21, 2012 at 4:40 AM, Alexander Solla alex.so...@gmail.com wrote: On Thu, Dec 20, 2012 at 12:53 PM, Oleksandr Manzyuk manz...@gmail.com wrote: I have no problems with the statement Objects of the category Hask are Haskell types. Types are well-defined syntactic entities. But

Re: [Haskell-cafe] monoid pair of monoids?

2012-12-21 Thread Steffen Schuldenzucker
Hi Christopher, On 12/21/2012 09:27 AM, Christopher Howard wrote: [...] Of course, I thought it would be likely I would want other classes and instances with additional numbers of types: code: data Socket3 a b c = Socket3 a b c deriving (Show) instance (Monoid a, Monoid b, Monoid

Re: [Haskell-cafe] monoid pair of monoids?

2012-12-21 Thread Ilya Portnov
Hi. Christopher Howard писал 21.12.2012 14:27: instance (Monoid a, Monoid b, Monoid c, Monoid d) = Monoid (Socket4 a b c d) where mempty = Socket4 mempty mempty mempty mempty Socket4 a b c d `mappend` Socket4 w x y z = Socket4 (a `mappend` w) (b `mappend` x) (c `mappend` y)

Re: [Haskell-cafe] monoid pair of monoids?

2012-12-21 Thread Sean Leather
On Fri, Dec 21, 2012 at 9:27 AM, Christopher Howard wrote: Thank you for your help. An additional question, if I might: For the sake of elegance and simplicity, I modified the class and instances to avoid the tuple aspect: data Socket2 a b = Socket2 a b instance (Monoid a, Monoid b) =

[Haskell-cafe] ghc-heap-view now with recursive pretty-printing

2012-12-21 Thread Joachim Breitner
Hi, I get the impression that blogs and planet.haskell.org are the best way to disseminate information about new tools any more. Maybe a part of the earlier importance has been taken over by GooglePlus, but not all, leaving both blogs and GooglePlus less useful individually? Anyways, I’d like to

[Haskell-cafe] MPTC or functional dependencies?

2012-12-21 Thread Petr P
Dear Haskellers, I'm working on a small library for representing semigroup (or monoid) actions on a set http://hackage.haskell.org/package/semigroups-actions. The MultiParamTypeClasses extension seems to be best suited for the task, as a group can act on many sets, and a set can be acted on by

Re: [Haskell-cafe] MPTC or functional dependencies?

2012-12-21 Thread Kim-Ee Yeoh
Petr, Your subject header is misleading: FDs don't make sense without MPTCs. As you acknowledge at the end, what you're ultimately asking is: to FD or not to FD. Note also, the contemporary debate has shifted to TFs (type families) vs FDs. -- Kim-Ee On Fri, Dec 21, 2012 at 7:38 PM, Petr P

Re: [Haskell-cafe] arr considered harmful

2012-12-21 Thread Kim-Ee Yeoh
Hey Conal, I have something (another circuits formulation) that's almost an arrow but doesn't support arr. Have you seen Adam Megacz's generalized arrows? http://www.cs.berkeley.edu/~megacz/garrows/ -- Kim-Ee On Fri, Dec 21, 2012 at 7:55 AM, Conal Elliott co...@conal.net wrote: If you

Re: [Haskell-cafe] MPTC or functional dependencies?

2012-12-21 Thread Petr P
Hi Kim-Ee, you're right, it's a bit misleading. I thought about TFs too, personally I mostly prefer them over FDs, but I'd like the library available for as many compilers as possible. 'semigroups' is just Haskell 98 and I'd like to keep the requirements similarly low. Best regards, Petr

[Haskell-cafe] Layer on a layer of record syntax in the type synonym?

2012-12-21 Thread Christopher Howard
Using a simple type I gave earlier from my monadic type question... code: data Socket3 a b c = Socket3 a b c deriving (Show) Is it possible somehow to layer on record syntax onto a synonym of the type? The idea would be something like this... code: type SpaceShip =

Re: [Haskell-cafe] MPTC or functional dependencies?

2012-12-21 Thread Roman Cheplyaka
* Petr P petr@gmail.com [2012-12-21 13:38:21+0100] Dear Haskellers, I'm working on a small library for representing semigroup (or monoid) actions on a set http://hackage.haskell.org/package/semigroups-actions. The MultiParamTypeClasses extension seems to be best suited for the task, as

Re: [Haskell-cafe] Layer on a layer of record syntax in the type synonym?

2012-12-21 Thread Ivan Lazar Miljenovic
On 22 December 2012 00:36, Christopher Howard christopher.how...@frigidcode.com wrote: Using a simple type I gave earlier from my monadic type question... code: data Socket3 a b c = Socket3 a b c deriving (Show) Is it possible somehow to layer on record syntax onto a

Re: [Haskell-cafe] Layer on a layer of record syntax in the type synonym?

2012-12-21 Thread Daniel Trstenjak
Hi Christopher, On Fri, Dec 21, 2012 at 04:36:04AM -0900, Christopher Howard wrote: Using a simple type I gave earlier from my monadic type question... code: data Socket3 a b c = Socket3 a b c deriving (Show) Is it possible somehow to layer on record syntax onto a

Re: [Haskell-cafe] Layer on a layer of record syntax in the type synonym?

2012-12-21 Thread Nicolas Trangez
On Fri, 2012-12-21 at 04:36 -0900, Christopher Howard wrote: Using a simple type I gave earlier from my monadic type question... code: data Socket3 a b c = Socket3 a b c deriving (Show) Is it possible somehow to layer on record syntax onto a synonym of the type?

Re: [Haskell-cafe] Categories (cont.)

2012-12-21 Thread Tillmann Rendel
Hi, Christopher Howard wrote: instance Category ... The Category class is rather restricted: Restriction 1: You cannot choose what the objects of the category are. Instead, the objects are always all Haskell types. You cannot choose anything at all about the objects. Restriction 2: You

[Haskell-cafe] Substituting values

2012-12-21 Thread Radical
Sometimes I'll need something like: if value == Foo then Bar else value Or some syntactic variation thereof: case value of { Foo - Bar; _ - value } Is there a better/shorter way to do it? I'm surprised that it's more complicated to substitute a value on its own than e.g. in a list, using

[Haskell-cafe] Fighting research paper bit-rot

2012-12-21 Thread cheater cheater
Hi guys, after yet another episode of trying to figure out why library code doesn't make any sense when reading the related paper, I decided to start a small wiki just for the purpose of describing differences between what's in the paper and what's in the code. The first article can be found at:

Re: [Haskell-cafe] Categories (cont.)

2012-12-21 Thread Chris Smith
It would definitely be nice to be able to work with a partial Category class, where for example the objects could be constrained to belong to a class. One could then restrict a Category to a type level representation of the natural numbers or any other desired set. Kind polymorphism should make

Re: [Haskell-cafe] Fighting research paper bit-rot

2012-12-21 Thread Patrick Mylund Nielsen
Thanks, this had me pretty confused too. STM.check itself also differs from in earlier versions of the library where it returned () or undefined. On Fri, Dec 21, 2012 at 8:35 PM, cheater cheater cheate...@gmail.comwrote: Hi guys, after yet another episode of trying to figure out why library

Re: [Haskell-cafe] Fighting research paper bit-rot

2012-12-21 Thread cheater cheater
Wow. Learning that there's anyone out there who finds this useful is one thing.. getting that after 3 minutes is another level of satisfying :) On Fri, Dec 21, 2012 at 8:39 PM, Patrick Mylund Nielsen hask...@patrickmylund.com wrote: Thanks, this had me pretty confused too. STM.check itself also

[Haskell-cafe] Troubles with DLLs

2012-12-21 Thread Henk-Jan van Tuyl
L.S., I am having troubles with DLLs; my application (Haskell, C and C++) gives several messages about DLLs not being found. I added these one by one to the current directory. At a certain point there are just error messages about null pointers and Segmentation fault/access violation in

Re: [Haskell-cafe] arr considered harmful

2012-12-21 Thread Conal Elliott
Thanks, Kim-Ee. Adam M's garrows look very useful for what I'm doing. -- Conal On Fri, Dec 21, 2012 at 5:14 AM, Kim-Ee Yeoh k...@atamo.com wrote: Hey Conal, I have something (another circuits formulation) that's almost an arrow but doesn't support arr. Have you seen Adam Megacz's

Re: [Haskell-cafe] Categories (cont.)

2012-12-21 Thread Jay Sulzberger
On Fri, 21 Dec 2012, Chris Smith cdsm...@gmail.com wrote: It would definitely be nice to be able to work with a partial Category class, where for example the objects could be constrained to belong to a class. One could then restrict a Category to a type level representation of the natural

Re: [Haskell-cafe] Layer on a layer of record syntax in the type synonym?

2012-12-21 Thread Christopher Howard
On 12/21/2012 04:52 AM, Daniel Trstenjak wrote: Why having a Socket3 in the first place, what's the point of it? The idea was to have some generic structures (Sockets) which were already instanced into the Monoids-within-Monoids abstraction, yet could still be made concrete into anything

Re: [Haskell-cafe] category design approach for inconvenient concepts

2012-12-21 Thread wren ng thornton
On 12/21/12 3:27 AM, Oleksandr Manzyuk wrote: On Fri, Dec 21, 2012 at 4:40 AM, Alexander Solla alex.so...@gmail.com wrote: I don't see how associativity fails, if we mod out alpha-equivalence. Can you give an example? (If it involves the value undefined, I'll have something concrete to add

Re: [Haskell-cafe] Categories (cont.)

2012-12-21 Thread wren ng thornton
On 12/20/12 7:07 PM, Christopher Howard wrote: On 12/20/2012 03:59 AM, wren ng thornton wrote: In order to fake this theory in Haskell we can do: newtype MonoidCategory a i j = MC a instance Monoid a = Category (MonoidCategory a) where id = MC mempty MC f

Re: [Haskell-cafe] Categories (cont.)

2012-12-21 Thread wren ng thornton
On 12/21/12 2:35 PM, Chris Smith wrote: It would definitely be nice to be able to work with a partial Category class, where for example the objects could be constrained to belong to a class. One could then restrict a Category to a type level representation of the natural numbers or any other

Re: [Haskell-cafe] Substituting values

2012-12-21 Thread Kim-Ee Yeoh
This is reminiscent of the Either (exception) monad where Left values, the exceptions, pass through unaltered, and Right values are transformable, i.e. acted on by functions. But I have no idea what you're trying to achieve in the bigger picture. Help us help you by fleshing out your use case.

Re: [Haskell-cafe] Troubles with DLLs

2012-12-21 Thread Henk-Jan van Tuyl
On Fri, 21 Dec 2012 21:08:43 +0100, Henk-Jan van Tuyl hjgt...@chello.nl wrote: 1) How can I find out which DLLs my application needs (and which package/library is to blame for it) I have found a partial answer: cygcheck from Cygwin can list dependencies on DLLs recursively, like this: