Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-06-03 Thread Henning Thielemann
Claus Reinke wrote: Do you argue that overloading logical operations like this in Haskell sacrifices type safety? Could programs go wrong [1] that use such abstractions? If I understand your point correctly, you are suggesting that such programs are still type safe. I agree with the claim

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-06-01 Thread Sebastian Fischer
On Jun 1, 2009, at 12:17 AM, Henning Thielemann wrote: On Thu, 28 May 2009, Bulat Ziganshin wrote: i use another approach which imho is somewhat closer to interpretation of logical operations in dynamic languages (lua, ruby, perl): [...] The absence of such interpretations and thus the

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-06-01 Thread Jason Dagit
On Mon, Jun 1, 2009 at 3:06 AM, Sebastian Fischer s...@informatik.uni-kiel.de wrote: On Jun 1, 2009, at 12:17 AM, Henning Thielemann wrote: On Thu, 28 May 2009, Bulat Ziganshin wrote: i use another approach which imho is somewhat closer to interpretation of logical operations in dynamic

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-06-01 Thread Claus Reinke
Do you argue that overloading logical operations like this in Haskell sacrifices type safety? Could programs go wrong [1] that use such abstractions? If I understand your point correctly, you are suggesting that such programs are still type safe. I agree with the claim that such features are

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-06-01 Thread Sebastian Fischer
Do you argue that overloading logical operations like this in Haskell sacrifices type safety? Could programs go wrong [1] that use such abstractions? If I understand your point correctly, you are suggesting that such programs are still type safe. My asking was really meant as a question to

Re[2]: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-31 Thread Henning Thielemann
On Thu, 28 May 2009, Bulat Ziganshin wrote: i use another approach which imho is somewhat closer to interpretation of logical operations in dynamic languages (lua, ruby, perl): a ||| b | isDefaultValue a = b | otherwise= a a b | isDefaultValue a = defaultValue |

Re[2]: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-29 Thread Nicolas Pouillard
Excerpts from Bulat Ziganshin's message of Thu May 28 15:07:02 +0200 2009: Hello Lennart, Thursday, May 28, 2009, 11:57:09 AM, you wrote: -- | Generalization of the 'Bool' type. Used by the generalized 'Eq' and 'Ord'. class Boolean bool where () :: bool - bool - bool --

RE: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Simon Peyton-Jones
anyway. Simon | -Original Message- | From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On | Behalf Of Sebastiaan Visser | Sent: 27 May 2009 13:32 | To: Haskell Cafe | Subject: [Haskell-cafe] Bool as type class to serve EDSLs. | | Hello, | | While playing

RE: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Sittampalam, Ganesh
as type class to serve EDSLs. Hello, While playing with embedded domain specific languages in Haskell I discovered the Num type class is a really neat tool. Take this simple example embedded language that can embed primitives from the output language and can do function application

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Lennart Augustsson
Message- | From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On | Behalf Of Sebastiaan Visser | Sent: 27 May 2009 13:32 | To: Haskell Cafe | Subject: [Haskell-cafe] Bool as type class to serve EDSLs. | | Hello, | | While playing with embedded domain

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Claus Reinke
Of course once you've got ifthenelse you find yourself wanting explicit desugaring of pattern matching (could view patterns help here?), Could you be more specific about what you want there, perhaps with a small example? I recognize the other problems from my own forays into EDSLs, but I'm not

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Sebastiaan Visser
08:46 To: Simon Peyton-Jones; Sebastiaan Visser; Haskell Cafe Cc: Augustsson, Lennart Subject: RE: [Haskell-cafe] Bool as type class to serve EDSLs. There are multiple possible classes that you might want under different circumstances (I think the most interesting issue is whether the class

Re[2]: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Bulat Ziganshin
Hello Lennart, Thursday, May 28, 2009, 11:57:09 AM, you wrote: -- | Generalization of the 'Bool' type. Used by the generalized 'Eq' and 'Ord'. class Boolean bool where () :: bool - bool - bool -- ^Logical conjunction. (||) :: bool - bool - bool -- ^Logical disjunction. i

[Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-27 Thread Sebastiaan Visser
Hello, While playing with embedded domain specific languages in Haskell I discovered the Num type class is a really neat tool. Take this simple example embedded language that can embed primitives from the output language and can do function application. data Expr :: * - * where Prim ::

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-27 Thread Edsko de Vries
+1. I agree completely, I've missed this often for exactly the same reasons. Edsko ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-27 Thread Miguel Mitrofanov
And I would certainly celebrate when if b then x else y expression becomes polymorphic in b. Edsko de Vries wrote on 27.05.2009 17:33: +1. I agree completely, I've missed this often for exactly the same reasons. Edsko ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-27 Thread Jason Dusek
2009/05/27 Miguel Mitrofanov miguelim...@yandex.ru: And I would certainly celebrate when if b then x else y expression becomes polymorphic in b. class Boolean b where fromBoolean :: b - Bool -- Jason Dusek ___ Haskell-Cafe mailing list