[Haskell-cafe] Non-derivable Typeable

2013-01-22 Thread Roman Cheplyaka
I need to declare a Typeable instance for a type which has an argument of kind * - *. GHC refuses to derive it. What is a recommended way to go about it? In particular, if I write the instance by hand, how important is the fingerprint, and how could I generate it? Roman

Re: [Haskell-cafe] Non-derivable Typeable

2013-01-22 Thread José Pedro Magalhães
Won't it derive it with StandaloneDeriving? Cheers, Pedro On Tue, Jan 22, 2013 at 1:28 PM, Roman Cheplyaka r...@ro-che.info wrote: I need to declare a Typeable instance for a type which has an argument of kind * - *. GHC refuses to derive it. What is a recommended way to go about it? In

Re: [Haskell-cafe] Non-derivable Typeable

2013-01-22 Thread Roman Cheplyaka
It doesn't seem to — am I doing something wrong? GHCi, version 7.6.1.20121207: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. Prelude :set

Re: [Haskell-cafe] Non-derivable Typeable

2013-01-22 Thread Roman Cheplyaka
I just found mkTyCon3 which generates the fingerprint automatically. (I was looking at Data.Typeable.Internal.mkTyCon before.) That answers my question. (Of course, a way to derive the instance would be even better...) Roman * Roman Cheplyaka r...@ro-che.info [2013-01-22 15:28:55+0200] I need

Re: [Haskell-cafe] Non-derivable Typeable

2013-01-22 Thread José Pedro Magalhães
Yes, that will work. But soon we'll have poly-kinded Typeable in HEAD, which will be able to derive that instance. Cheers, Pedro On Tue, Jan 22, 2013 at 2:34 PM, Roman Cheplyaka r...@ro-che.info wrote: I just found mkTyCon3 which generates the fingerprint automatically. (I was looking at

Re: [Haskell-cafe] Non-derivable Typeable

2013-01-22 Thread Roman Cheplyaka
Thanks, looking forward to it! Roman * José Pedro Magalhães j...@cs.uu.nl [2013-01-22 14:41:25+] Yes, that will work. But soon we'll have poly-kinded Typeable in HEAD, which will be able to derive that instance. Cheers, Pedro On Tue, Jan 22, 2013 at 2:34 PM, Roman Cheplyaka

Re: [Haskell-cafe] Mobile app development?

2013-01-22 Thread Stefan Kersten
On Jan 19, 2013, at 10:29 PM, Nathan Hüsken wrote: Recently I managed to get ghc to target android working (this still needs some work): [4]. this is great news, thanks! Of couse, ffi bindings for all these platforms would be needed to get serious. i think that you can get quite serious

Re: [Haskell-cafe] [Haskell] ANNOUNCE: MFlow 0.2

2013-01-22 Thread Heinrich Apfelmus
Alberto G. Corona wrote: The template look is very simple but it uses a lot of dynamic code behind I changed the template to something more light. http://haskell-web.blogspot.com.es/ Much better, thanks! Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com

Re: [Haskell-cafe] Mobile app development?

2013-01-22 Thread Andrew Pennebaker
Can we un-deprecate GHC's ability to compile to C code? C may be the best option to bridge to mobile, as Android, iOS, and Windows RT do support C/C++ apps. On Jan 22, 2013 2:14 PM, Dan Choi dhc...@gmail.com wrote: What about the option of using Haskell's Parsec or AttoParsec to implement a

Re: [Haskell-cafe] Mobile app development?

2013-01-22 Thread Brandon Allbery
On Tue, Jan 22, 2013 at 2:40 PM, Andrew Pennebaker andrew.penneba...@gmail.com wrote: Can we un-deprecate GHC's ability to compile to C code? C may be the best option to bridge to mobile, as Android, iOS, and Windows RT do support C/C++ apps. The C code generated by GHC, except in

Re: [Haskell-cafe] ANN: Haskell bindings for the igraph C library

2013-01-22 Thread George Giorgidze
Hi Jason, How does this compare with fgl? http://hackage.haskell.org/package/fgl A couple of months ago, I was working on a project where I had to do some graph analysis. I encountered two problems with the fgl library: (1) The fgl library did not work for large graphs, even graph construction

Re: [Haskell-cafe] ANN: Haskell bindings for the igraph C library

2013-01-22 Thread Jason Dagit
On Tue, Jan 22, 2013 at 3:20 PM, George Giorgidze giorgi...@gmail.comwrote: Hi Jason, How does this compare with fgl? http://hackage.haskell.org/package/fgl A couple of months ago, I was working on a project where I had to do some graph analysis. I encountered two problems with the fgl

[Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
monad-bool implements a pair of Boolean monoids and monads, to support short-circuiting, value-returning computations similar to what Python and Ruby offer with their native and || operators. For example, in Python you might see this: x = [1,2,3,0] print x[1] || x[3] --

Re: [Haskell-cafe] [Haskell] ANN: monad-bool 0.1

2013-01-22 Thread Henning Thielemann
On Tue, 22 Jan 2013, John Wiegley wrote: Use 'onlyIf' with AndM and AndMT to guard later statements, which are only evaluated if every preceding 'onlyIf' evaluates to True. For example: foo :: AndM Int foo = do onlyIf (True == True) return 100 onlyIf (True ==

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread Conrad Parker
On 23 January 2013 08:04, John Wiegley jo...@fpcomplete.com wrote: monad-bool implements a pair of Boolean monoids and monads, to support short-circuiting, value-returning computations similar to what Python and Ruby offer with their native and || operators. ... Use 'onlyIf' with AndM and

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread Roman Cheplyaka
* John Wiegley jo...@fpcomplete.com [2013-01-22 18:04:36-0600] monad-bool implements a pair of Boolean monoids and monads, to support short-circuiting, value-returning computations similar to what Python and Ruby offer with their native and || operators. Random thoughts after

Re: [Haskell-cafe] [Haskell] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
Henning Thielemann lemm...@henning-thielemann.de writes: Does the And monad fulfill the monad laws? In a proper monad an interim (return x) (without a '-') is a no-op. You are very right. I will make the necessary changes. -- John Wiegley FP Complete Haskell tools,

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
Conrad Parker con...@metadecks.org writes: these sound powerful, but how would I do something esoteric like if/elseIf/endIf ? Can you show me an example of what you'd like to express? -- John Wiegley FP Complete Haskell tools, training and consulting

Re: [Haskell-cafe] Mobile app development?

2013-01-22 Thread Kristopher Micinski
I don't believe that was really the point of the C compiler, and I'd suspect you'd have a hard time with the runtime. By the way, the Android APIs aren't really meant to be used by native code: the only real use for native code in Android is GPU code and math code (think games and DSP-type

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread Conrad Parker
On 23 January 2013 09:25, John Wiegley jo...@fpcomplete.com wrote: Conrad Parker con...@metadecks.org writes: these sound powerful, but how would I do something esoteric like if/elseIf/endIf ? Can you show me an example of what you'd like to express? Your examples look vaguely like an

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread Ertugrul Söylemez
Roman Cheplyaka r...@ro-che.info wrote: - what do you need unsafeCoerce for? The unsafeCoerce is needed because the library is severely broken. Consider this: do onlyIf False x - c onlyIf True return x There is a good reason why Haskell's type system would never have

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
Roman Cheplyaka r...@ro-che.info writes: - what do you need unsafeCoerce for? Ok, after much discussion with edwardk and shachaf, I came to realize a few things: 1. The functionality of my two monads 'AndM' and 'OrR' can be boiled down to two helper functions inside EitherT:

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
Ertugrul Söylemez e...@ertes.de writes: There is a good reason why Haskell's type system would never have allowed to write this library. I recommend the author to try again without unsafeCoerce. It won't work. You are right, and in fact what I wanted to do cannot be done. It requires

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
John Wiegley jo...@fpcomplete.com writes: And EitherT can already do that, it just lacks a convenience function to make it easier (i.e, not having to write lots of nested if statements). Never mind, when/unless + left work just fine for this. -- John Wiegley FP Complete

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread John Wiegley
John Wiegley jo...@fpcomplete.com writes: Never mind, when/unless + left work just fine for this. You know, it's been a humorous day. First ekmett showed that I can't make a sane Monad instance for AndM or OrM. Then I discovered I can't make a reasonable Monoid (no mempty, given only

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-22 Thread Ertugrul Söylemez
John Wiegley jo...@fpcomplete.com wrote: And poof, all my code just disappeared... Welcome to Haskell. =) Greets, Ertugrul -- Not to be or to be and (not to be or to be and (not to be or to be and (not to be or to be and ... that is the list monad. signature.asc Description: PGP signature