Re: [Haskell-cafe] Hoogle vs Hayoo

2013-08-23 Thread Daniel Trstenjak
On Fri, Aug 23, 2013 at 10:12:27AM +0200, Erik Hesselink wrote: Note that the 'normal' hoogle indexes all (?) of hackage. But by default it only searches the haskell platform. You can add a package with '+' to search in that package. E.g. PublicKey +crypto-api. If the idea behind this, that

Re: [Haskell-cafe] Identity of indiscernibles

2013-08-08 Thread Daniel Trstenjak
Hi Tom, See [1] for an explanation of free monads in general. For IO in particular, define a functor data IOF a = GetChar (Char - a) | PutChar Char a | ... with constructors for all elementary IO operations. But how should this work if the user adds an IO operation, e.g by wrapping

Re: [Haskell-cafe] Generating Haskell Code out of Haskell AST (GHC API)

2013-07-19 Thread Daniel Trstenjak
Hi John, Alan - I do NOT want to generate Haskell code. I want only to generate AST and compile it. The question about generating the code was only to have a debugging tool - to see if the generated AST is good - I wanted to generate the Haskell code only to check if its correct, but

Re: [Haskell-cafe] HTML framework for web-ui

2013-05-21 Thread Daniel Trstenjak
Hi Adrian, What's an exception? I thought Haskell used Maybe. Haskell also has exceptions: dan@machine ~ ghci Prelude head [] *** Exception: Prelude.head: empty list I also consider them as quite problematic, especially if they're used in libraries, but sometimes we're all a bit lazy and

Re: [Haskell-cafe] list comprehension doesn't work

2013-05-15 Thread Daniel Trstenjak
Hi Mateusz, I don't think my post was out of order at all and I don't understand why it sparked such an... energetic response - that wasn't my intent at all. A friendly response might contain the things you told John, but it could also be a bit more empathic, otherwise its easy to perceive

Re: [Haskell-cafe] case switch covering all possible constructor but still fails

2013-04-13 Thread Daniel Trstenjak
Hi Nathan, DataAlt c | Right tag - genDataConTag c - return $ Cond tag Are you sure, that genDataConTag always returns a 'Right'? If it returns a 'Left', than the pattern won't match. Greetings, Daniel ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Prolog-style patterns

2013-04-09 Thread Daniel Trstenjak
Hi Roman, One issue with it in Haskell is that it'd lead to inconsistent semantics: myEq x x = True is not the same as myEq x y = case y of x - True I don't think that it's inconsistent, because the 'case' defines a new name scope, like the function does for its

Re: [Haskell-cafe] Prolog-style patterns

2013-04-09 Thread Daniel Trstenjak
Hi Roman, In fact, lots of Haskell newcomers are surprised that f 10 = 42 is not the same as n = 10 f n = 42 Well, yes, at the beginning I've been also surprised about this. But allowing this seems to be even more error prone, because now you could bind function arguments to

Re: [Haskell-cafe] Prolog-style patterns

2013-04-09 Thread Daniel Trstenjak
Hi Jan, On Tue, Apr 09, 2013 at 01:32:33PM +0200, Jan Stolarek wrote: Thanks for pointing me to earlier discussions on this subject - they are enlightening :) One particular argument against seems to be very convincing to me: From a language design point of view, it should be noted that

Re: [Haskell-cafe] code-as-config, run-time checks and error locations

2013-04-06 Thread Daniel Trstenjak
Hi Steffen, most of the time I'm just using these cpp macros: #define __POS__(__FILE__ ++ : ++ show __LINE__) #define ERROR error $ __POS__ ++ - ++ Instead of writing 'error blub' you would write 'ERROR blub' and additionally get the file name and the line. There's a bracktracing

Re: [Haskell-cafe] Remove redundancy with Template Haskell

2013-03-27 Thread Daniel Trstenjak
Hi Corentin, On Wed, Mar 27, 2013 at 09:13:41PM +0100, Corentin Dupont wrote: I have a function that looks like this: call :: SomeFunction - String - SomeState The string is actually the representation of the function passed in parameter. It is stored in the state for documentation. So a

Re: [Haskell-cafe] Make a DSL serializable

2013-03-25 Thread Daniel Trstenjak
Hi Michael, On Sun, Mar 24, 2013 at 05:13:35PM -0500, Michael Better wrote: Isn't this similar to the problem Cloud Haskell had to solve to send code to another process to run? As much as I know, the sendable code of 'Cloud Haskell' is limited, you can't just send any kind of function.

Re: [Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Daniel Trstenjak
Hi Corentin, I have a DSL like this: data Exp where OnEvent :: EventName - (Int - Exp) - Exp (...) The OnEvent element carries a function (the handler to be called when the event happens), and that makes my DSL non showable/serializable. How could I fix that? This is a real

Re: [Haskell-cafe] Overloading

2013-03-10 Thread Daniel Trstenjak
Hi Peter, -- smart constructor with serialNumber date serialNumber | serialNumber 0 = Date serialNumber | otherwise = error (invalid serialNumber ++ show serialNumber) Instead of raising an error it's more secure to return a Maybe value. date :: Int - Maybe Date date

Re: [Haskell-cafe] RFC: rewrite-with-location proposal

2013-02-26 Thread Daniel Trstenjak
Hi Michael, On Mon, Feb 25, 2013 at 02:41:19PM +0200, Michael Snoyman wrote: At that point, we've now made two changes to REWRITE rules: 1. They can takes a new ALWAYS parameters. 2. There's a new, special identifier currentLocation available. What would be the advantage is of that

Re: [Haskell-cafe] layers: A prototypical 2d platform game

2013-02-19 Thread Daniel Trstenjak
Hi Henk-Jan, It seems to me that there is something missing from this e-mail. What are you missing? Greetings, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] layers: A prototypical 2d platform game

2013-02-19 Thread Daniel Trstenjak
On Tue, Feb 19, 2013 at 02:15:33PM +0100, Vo Minh Thu wrote: Screenshots obviously ;) Hurray! attachment: layers.png___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] layers: A prototypical 2d platform game

2013-02-18 Thread Daniel Trstenjak
Hi all, also if there's not that much to see and only a few minutes of gameplay, but after spending quite a few hours writing it, getting a feeling for Haskell and it's usage, perhaps it's in some way useful for someone, even if just for a few minutes of distraction.

Re: [Haskell-cafe] ANN: hgdbmi 0.2, GDB Machine Interface

2013-01-19 Thread Daniel Trstenjak
Hi Alex, On Fri, Jan 18, 2013 at 08:26:10PM +0100, Alexander Bernauer wrote: I thought it would make sense to use these names for ease of reference. Given this, would you still prefer them being grouped in separate modules? Yes, I still think that having separate modules can be beneficial,

Re: [Haskell-cafe] ANN: hgdbmi 0.2, GDB Machine Interface

2013-01-18 Thread Daniel Trstenjak
Hi Alexander, On Thu, Jan 17, 2013 at 10:17:33PM +0100, Alexander Bernauer wrote: I am happy to announce the second release of hgdbmi, a Haskell implementation of the GDB Machine Interface. Nice project! :) PS: This is my first serious Haskell package. If you see something that you

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] Hackage suggestion: Gather the list of the licenses of all dependencies of a package

2012-12-13 Thread Daniel Trstenjak
On Thu, Dec 13, 2012 at 08:40:09PM +0200, Michael Snoyman wrote: If you have a commercial use for cpphs, and feel the terms of the (L)GPL are too onerous, you have the option of distributing unmodified binaries (only, not sources) under the terms of a different licence (see

[Haskell-cafe] Common function names for '(.) . (.)', '(.) . (.) . (.)' ...?

2012-11-21 Thread Daniel Trstenjak
Greetings, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Not exporting a class

2012-11-11 Thread Daniel Trstenjak
Hi Joachim, On Sun, Nov 11, 2012 at 02:10:34PM +0100, Joachim Breitner wrote: dear package authors. If you define a useful class, please think twice before you do not export the methods, otherwise something like this will happen: I like the way 'Common Lisp' deals with this issue. Exported

[Haskell-cafe] Input Handling, Callbacks, State Machines

2012-11-03 Thread Daniel Trstenjak
Hi all, I'm currently struggling in the search for a nice abstraction for the input handling of a game (it's a simple platformer with rectangular platforms). One good example is the level editor of the game. When pressing the left mouse button the creation of a new platform is started. As long

Re: [Haskell-cafe] Sparse records/ADTs

2012-10-24 Thread Daniel Trstenjak
Hi Jon On Wed, Oct 24, 2012 at 11:08:29AM +0100, Jon Fairbairn wrote: for each field, which is tedious (and O(n)). Obviously Templates would help, but is there an alternative I’ve missed? perhaps something like: data Type = Ta | Tb | Tc ... data E= Ea A | Eb B | Ec C | ... type D=

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-17 Thread Daniel Trstenjak
On Thu, Aug 16, 2012 at 11:33:17PM -0400, wren ng thornton wrote: However, there are certainly cases where we have hard upper bounds[1][2][3], and ignoring those is not fine. Circumventing hard upper bounds should require altering the .cabal file, given as getting things to compile will

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-16 Thread Daniel Trstenjak
On Wed, Aug 15, 2012 at 03:54:04PM -0700, Michael Sloan wrote: Upper bounds are a bit of a catch-22 when it comes to library authors evolving their APIs: 1) If library clients aren't encouraged to specify which version of the exported API they target, then changing APIs can lead to

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-12 Thread Daniel Trstenjak
Hi Oleg, On Sat, Aug 11, 2012 at 08:14:47AM -, o...@okmij.org wrote: I'd like to point out that the only operation we can do on the first argument of MkFoo is to show to it. This is all we can ever do: we have no idea of its type but we know we can show it and get a String. Why not to

[Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-07 Thread Daniel Trstenjak
Hi all, it should be possible a call a function on all elements of the data structure, to add and remove elements. What I currently have: the type class: class Foo a where hasId :: a - Int - Maybe a a few instances: data A = A deriving Show instance Foo A where hasId a 1 = Just a

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-07 Thread Daniel Trstenjak
Hi Joey, On Tue, Aug 07, 2012 at 02:13:09PM -0400, Joey Adams wrote: Are you looking for existential quantification [1]? data SomeFoo = forall a. Foo a = a [1]: http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html#existential-quantification Thanks!

Re: [Haskell-cafe] Maintainer of pngload listening?

2012-06-30 Thread Daniel Trstenjak
Hi Ivan, thanks, but l have been able to build it by myself. I just want to get the package updated and if the maintainer can't be reached, than ask for maintainership. Greetings, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Maintainer of pngload listening?

2012-06-28 Thread Daniel Trstenjak
Hi, Marko Lauronens email address from the package is invalid, so I'm trying to reach him this way. pngload doesn't compile with ghc = 7.2 because of it's dependency to base and haskell98. Greetings, Daniel ___ Haskell-Cafe mailing list