Re: [Haskell-cafe] GHC and backwards compatibility

2013-08-19 Thread Albert Y. C. Lai
On 13-08-19 10:58 AM, Ketil Malde wrote: b) the output isn't very helpful in tracking down the cause of this problem, it claims that all these packages depend on array-0.4.0.1, which is a lie. Somewhere, somehow, somethings depends on this (or at least a newer version), but I have no clue how

Re: [Haskell-cafe] Errors in non-monadic code

2013-08-19 Thread Jerzy Karczmarczuk
Le 20/08/2013 00:19, jabolo...@google.com a écrit : If I understand correctly, by escaping continuations you mean that you can easily transfer control between the point where the exception is raised and the exception handler. If this is what you mean, you can achieve the same effect with

Re: [Haskell-cafe] Errors in non-monadic code

2013-08-19 Thread Tom Ellis
On Tue, Aug 20, 2013 at 12:25:44AM +0200, Jerzy Karczmarczuk wrote: Le 20/08/2013 00:19, jabolo...@google.com a écrit : If I understand correctly, by escaping continuations you mean that you can easily transfer control between the point where the exception is raised and the exception handler.

[Haskell-cafe] Categories with associated constraints?

2013-08-19 Thread Conal Elliott
Has anyone given a go at a Category class and friends (including cartesian and closed) with associated constraints (presumably using the ConstraintKinds language extension)? I gave it a try a while back and wasn't able to keep the signatures from getting very complicated. Thanks, -- Conal

Re: [Haskell-cafe] Categories with associated constraints?

2013-08-19 Thread Carter Schonwald
I've not seen such, Mike Izbicki has something related for most of the other standard classes (though i've not looked closely at it myself) http://hackage.haskell.org/package/ConstraintKinds-1.1.0.0 On Mon, Aug 19, 2013 at 6:45 PM, Conal Elliott co...@conal.net wrote: Has anyone given a go at

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread AntC
Daniel F difrumin at gmail.com writes: Can you please elaborate why this inconsistency is annoying and what's the use of OneTuple? Genuine question, Hi Daniel, the main annoyance is the verbosity (of using a data type and constructor), and that it no longer looks like a tuple. The

Re: [Haskell-cafe] abs minBound (0 :: Int) negate minBound == (minBound :: Int)

2013-08-19 Thread Richard A. O'Keefe
On 20/08/2013, at 3:43 AM, Kyle Miller wrote: On Sun, Aug 18, 2013 at 8:04 PM, Richard A. O'Keefe o...@cs.otago.ac.nz wrote: The argument for twos-complement, which always puzzled me, is that the other systems have two ways to represent zero. I never found this to be a problem, not even

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread Ivan Lazar Miljenovic
On 20 August 2013 11:07, AntC anthony_clay...@clear.net.nz wrote: Daniel F difrumin at gmail.com writes: Can you please elaborate why this inconsistency is annoying and what's the use of OneTuple? Genuine question, Hi Daniel, the main annoyance is the verbosity (of using a data type and

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread Mike Ledger
It seems to me that this is Identity given a different name. A bonus of using Identity is that it won't introduce any new packages to the majority of installations. On 20/08/2013 1:17 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 20 August 2013 11:07, AntC

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread AntC
Mike Ledger eleventynine at gmail.com writes: It seems to me that this is Identity given a different name. A bonus of using Identity is that it won't introduce any new packages to the majority of installations. On 20/08/2013 1:17 PM, Ivan Lazar Miljenovic wrote: ... isn't a single

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread Chris Wong
It seems to me that this is Identity given a different name. Close. But Identity is declared using newtype (just like monad transformers), whereas OneTuple is declared with data (like the other tuples). This may or may not matter, depending on your use case. On 20/08/2013 1:17 PM, Ivan Lazar

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-18 Thread damodar kulkarni
Thanks again for the detailed and explanatory answer. That's the reason I'm writing these huge responses, because I hope I can shorten this journey for others. This has certainly helped me grasp some aspects in this regard. While Monad Transformers are awesome and can solve many problems

[Haskell-cafe] ANN: hspec-test-framework - Run test-framework tests with Hspec

2013-08-18 Thread Simon Hengel
Hi, I just released hspec-test-framework[1] and hspec-test-framework-th[2] to Hackage. They can be used to run test-framework tests with Hspec unmodified. This can also be used to work around test-framework's incompatibility with QuickCheck-2.6 and base-4.7.0 ;) Have a look at the README for

Re: [Haskell-cafe] ANN: hspec-test-framework - Run test-framework tests with Hspec

2013-08-18 Thread Alfredo Di Napoli
Hi Simon, this is an exciting news! May I ask the question that maybe is lurking in the shadow? Due to the recent announcement of Roman's tasty library, are there plans to basically release something similar to hspec-test-framework and hspec-test-framework-th but targeting tasty instead? Bye

[Haskell-cafe] abs minBound (0 :: Int) negate minBound == (minBound :: Int)

2013-08-18 Thread Nicolas Frisby
The docs at http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:gcd give a NB mentioning that (abs minBound == minBound) is possible for fixed-width types. This holds, for example, at Int. It is also the case that (negate minBound == minBound). Two questions: 1) This

Re: [Haskell-cafe] Alternative name for return

2013-08-18 Thread Nikolaos Bezirgiannis
Dag Odenhall dag.odenh...@gmail.com writes: I particularly like she's (her?) syntax for Alternative. Not sure whether or not Idris has that. Applicative tuples would be nice too, something like (|a,b,c|) translating to liftA3 (,,) a b c. And operators too, liftA2 (+) a b as (| a + b |)? I

[Haskell-cafe] ANN: processing-1.2.0.0. Graphic web applications with processing.js.

2013-08-18 Thread Daniel Díaz Casanueva
Hello readers of Haskell-Cafe. Yesterday I uploaded a new version of the processing library [1]. == What is this library for? == The library is oriented to create graphic applications that run in a web browser, with no need of running a server. It provides the user with a set of functions and

Re: [Haskell-cafe] ANN: hspec-test-framework - Run test-framework tests with Hspec

2013-08-18 Thread Simon Hengel
Hi, Due to the recent announcement of Roman's tasty library, are there plans to basically release something similar to hspec-test-framework and hspec-test-framework-th but targeting tasty instead? I care about Hspec[1] and want to provide an upgrade path for test-framework users, but I'm

[Haskell-cafe] MongoDB single insertions super slow

2013-08-18 Thread Kyle Hanson
I am trying to write a simple benchmark of testing 1000 single inserts in mongodb, but doing single insertions is super slow. It takes nearly 40 seconds to perform these operations with the haskell mongodb driver, but under a second to perform the same number of operations of single inserts in

Re: [Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-18 Thread Hartmut Pfarr
Hi Tom, I played a bit with your suggestion, and it is running now :-) But instead of IO [Int] I think we need IO [Only Int] because of the 1-element-tupel problem? With IO [Only Int] it looks like this:

Re: [Haskell-cafe] MongoDB single insertions super slow

2013-08-18 Thread Carter Schonwald
Have you contacted the maintainer? I believe that the Haskell mongodb driver is maintained by someone at 10gen? (Or at least at some point was ) Without spending time looking at the mongo driver, it's hard to know. On Aug 18, 2013 3:58 PM, Kyle Hanson hanoo...@gmail.com wrote: I am trying to

Re: [Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-18 Thread Tom Ellis
On Sun, Aug 18, 2013 at 10:16:06PM +0200, Hartmut Pfarr wrote: I played a bit with your suggestion, and it is running now :-) But instead of IO [Int] I think we need IO [Only Int] because of the 1-element-tupel problem? Yes you're right. I had forgotten that postgresql-simple dealt with

Re: [Haskell-cafe] abs minBound (0 :: Int) negate minBound == (minBound :: Int)

2013-08-18 Thread Richard A. O'Keefe
On 19/08/2013, at 3:38 AM, Nicolas Frisby wrote: The docs at http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:gcd give a NB mentioning that (abs minBound == minBound) is possible for fixed-width types. At least three ways to represent negative integers in

[Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Christopher Done
Anyone ever needed this? Me and John Wiegley were discussing a decent name for it, John suggested inv as in involution. E.g. inv reverse (take 10) inv reverse (dropWhile isDigit) trim = inv reverse (dropWhile isSpace) . dropWhile isSpace That seems to be the only use-case I've ever come across.

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Ivan Lazar Miljenovic
On 17 August 2013 19:11, Christopher Done chrisd...@gmail.com wrote: Anyone ever needed this? Me and John Wiegley were discussing a decent name for it, John suggested inv as in involution. E.g. In terms of a decent name: as soon as I saw the subject, I thought you were somehow inverting a

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Mateusz Kowalczyk
On 17/08/13 10:11, Christopher Done wrote: Anyone ever needed this? Me and John Wiegley were discussing a decent name for it, John suggested inv as in involution. E.g. First thing I thought was ‘inverse’… inv reverse (take 10) inv reverse (dropWhile isDigit) trim = inv reverse (dropWhile

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Ian Ross
In J (a sort of dialect of APL), there's a thing called under, written .. The expression (f . g) x is equivalent to (g^:_1) (f (g x)) where g^:_1 is J's obverse of g, which in cases where it exists is usually the inverse of g ( http://www.jsoftware.com/help/dictionary/intro26.htm). Abusing

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-17 Thread Mathijs Kwik
damodar kulkarni kdamodar2...@gmail.com writes: Thanks for this nice analogy and explanation. This brings monad transformers to my mind. without monad transformers, the monads are bit crippled in their applicability (please correct me if I am wrong) and with monad transformers the code

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Tom Ellis
On Sat, Aug 17, 2013 at 11:11:07AM +0200, Christopher Done wrote: Anyone ever needed this? Me and John Wiegley were discussing a decent name for it, John suggested inv as in involution. E.g. inv reverse (take 10) inv reverse (dropWhile isDigit) trim = inv reverse (dropWhile isSpace) .

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Tobias Dammers
Note that at least for the dropWhile example, there is a specialized function, dropWhileEnd, which is most likely more efficient than reversing the list twice. On Aug 17, 2013 3:35 PM, Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote: On Sat, Aug 17, 2013 at 11:11:07AM +0200,

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Joachim Breitner
Hi, Am Samstag, den 17.08.2013, 11:11 +0200 schrieb Christopher Done: inv reverse (take 10) if you want that fast and lazy, check out http://www.joachim-breitner.de/blog/archives/600-On-taking-the-last-n-elements-of-a-list.html Greetings, Joachim -- Joachim “nomeata” Breitner

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Anton Nikishaev
Christopher Done chrisd...@gmail.com writes: Anyone ever needed this? Me and John Wiegley were discussing a decent name for it, John suggested inv as in involution. E.g. inv reverse (take 10) inv reverse (dropWhile isDigit) trim = inv reverse (dropWhile isSpace) . dropWhile isSpace That

[Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-17 Thread Hartmut Pfarr
Hello, I've a problem connecting to my postgresql database. Can You help me fix the ambigious type signature? (The example is identical to the first 5-liner-example in the package documentation)

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-17 Thread David Menendez
On Sat, Aug 17, 2013 at 8:23 AM, Mathijs Kwik math...@bluescreen303.nlwrote: damodar kulkarni kdamodar2...@gmail.com writes: Thanks for this nice analogy and explanation. This brings monad transformers to my mind. without monad transformers, the monads are bit crippled in their

Re: [Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-17 Thread Brandon Allbery
On Sat, Aug 17, 2013 at 1:35 PM, Hartmut Pfarr hartmut0...@googlemail.comwrote: (The example is identical to the first 5-liner-example in the package documentation) As I read it, the example has a typo: it should be using `query_` instead of `query`. See

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Dan Burton
This is indeed a job for lens, particularly, the Iso type, and the under function. Lens conveniently comes with a typeclassed isomorphism called reversed, which of course has a list instance. under reversed (take 10) ['a'.. 'z'] qrstuvwxyz -- Dan Burton On Aug 17, 2013 10:23 AM, Anton Nikishaev

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread Dan Burton
The lens docs even have an example of another helper function, involuted for functions which are their own inverse. live involuted reverse %~ ('d':) lived inv f g = involuted f %~ g http://hackage.haskell.org/packages/archive/lens/3.9.0.2/doc/html/Control-Lens-Iso.html#v:involuted -- Dan

Re: [Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-17 Thread Hartmut Pfarr
Thx, I changed now from query to query_ Now the coding is like that: {-# LANGUAGE OverloadedStrings #-} import Database.PostgreSQL.Simple import Database.PostgreSQL.Simple.FromRow hello :: (FromRow a) = IO [a] hello = do

Re: [Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-17 Thread Tom Ellis
On Sat, Aug 17, 2013 at 11:59:24PM +0200, Hartmut Pfarr wrote: {-# LANGUAGE OverloadedStrings #-} import Database.PostgreSQL.Simple import Database.PostgreSQL.Simple.FromRow hello :: (FromRow a) = IO [a] hello = do conn - connect defaultConnectInfo query_ conn select 2 + 2 Either

Re: [Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-17 Thread Brandon Allbery
On Sat, Aug 17, 2013 at 5:59 PM, Hartmut Pfarr hartmut0...@googlemail.comwrote: query_ conn select 2 + 2 I've no errors any more. But: I don't see any result (for sure, it is not coeded yet) Yes, because you're not capturing it; it's the return value from `query_`, which you are throwing

Re: [Haskell-cafe] inv f g = f . g . f

2013-08-17 Thread John Wiegley
Dan Burton danburton.em...@gmail.com writes: under reversed (take 10) ['a'.. 'z'] qrstuvwxyz Excellent, thanks! -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net

[Haskell-cafe] continuations and monads

2013-08-17 Thread Christopher Howard
Q: Are the continuations in Scheme related to the monads from Haskell? If so, could someone elaborate on that? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] continuations and monads

2013-08-17 Thread Tikhon Jelvis
Yes they are. Purely intuitively, you can see how writing code in a monadic style (using = a lot) is very similar to writing in continuation-passing style. You can express this the most directly with the continuation monad. Then, from this monad, you can express other monads. In some sense, the

Re: [Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-17 Thread Hartmut Pfarr
... thx all for helping. Now the coding works: it puts the following out. Kind regards Hartmut *Main main Only {fromOnly = 4} -- Only {fromOnly = 101} Only {fromOnly = 102} Only {fromOnly = 103} -- blub 101 51 blub 102 52 blub 103 53 The

Re: [Haskell-cafe] Haddock multiple definitions

2013-08-16 Thread Mateusz Kowalczyk
On 15/08/13 23:07, jabolo...@google.com wrote: Hi, I cannot find a similar ticket, so it seems that no one has filed this issue before. As a general comment, I think this issue is a good example that perhaps docstrings should go in the AST. In any case, I would ask someone with a trac

Re: [Haskell-cafe] Haddock multiple definitions

2013-08-16 Thread Mateusz Kowalczyk
On 16/08/13 08:16, Mateusz Kowalczyk wrote: In the future, please try with more recent version of GHC. This is no longer a parse error with HEAD or 7.6.3. Instead, given -- | 'y' and 'x' are here (x, y) = (1, 2) you get documentation generated for ‘x’ and Haddock doesn't seem to have

Re: [Haskell-cafe] Retrieving Haddock comments with haskell-src-exts

2013-08-16 Thread Niklas Broberg
Hi again, Hmm. I see the difficulty here, and eventually I would want to have support for this, but alas, not yet. If you come up with any solution that doesn't involve GHC (or only marginally so), I'd love to hear it. Cheers, Niklas On Wed, Aug 14, 2013 at 8:57 PM, Mateusz Kowalczyk

[Haskell-cafe] Does exist something like data-files in Cabal, which works at compile time?

2013-08-16 Thread Alfredo Di Napoli
Hello guys, I'm pretty sure the answer is no, but I was hoping to get some extra insight / best practices. The problem can be summarised by this SO question (not the OP, but I have the same problem): http://stackoverflow.com/questions/15731170/cabal-how-to-add-text-file-as-a-build-dependency As

Re: [Haskell-cafe] Haddock multiple definitions

2013-08-16 Thread Roman Cheplyaka
* Mateusz Kowalczyk fuuze...@fuuzetsu.co.uk [2013-08-16 08:16:35+0100] In the future, please try with more recent version of GHC. This is no longer a parse error with HEAD or 7.6.3. Uhm, actually there is, with 7.6.3. % cat haddock.hs -- Main -- | Blah blah blah (x, y, z) = (1,

Re: [Haskell-cafe] Does exist something like data-files in Cabal, which works at compile time?

2013-08-16 Thread Daniel Díaz Casanueva
What I have always done to solve this is to create a custom Setup.hs. Something like: Setup.hs - import Distribution.Simple main :: IO () main = doThisBeforeInstall defaultMain - Then you specify in your .cabal file that the Build-Type is Custom. Best regards, Daniel

Re: [Haskell-cafe] Does exist something like data-files in Cabal, which works at compile time?

2013-08-16 Thread Alfredo Di Napoli
Hi Daniel, It's the path I've eventually took as well. Many thanks, Sent from my iPad On 16/ago/2013, at 11:13, Daniel Díaz Casanueva dhelta.d...@gmail.com wrote: What I have always done to solve this is to create a custom Setup.hs. Something like: Setup.hs - import

Re: [Haskell-cafe] Does exist something like data-files in Cabal, which works at compile time?

2013-08-16 Thread Dag Odenhall
You want extra-source-files. They'll be included in the tarball, and cabal always builds from the root of the package, so you can safely use relative paths. On Fri, Aug 16, 2013 at 11:58 AM, Alfredo Di Napoli alfredo.dinap...@gmail.com wrote: Hello guys, I'm pretty sure the answer is no,

Re: [Haskell-cafe] Does exist something like data-files in Cabal, which works at compile time?

2013-08-16 Thread Alfredo Di Napoli
Thanks Dag, I'll give it a spin. Btw, I've successfully solved my problem with the following Setup.hs, I'm posting it here in case someone will find this useful in the future: #!/usr/bin/env runhaskell import Distribution.Simple import Distribution.PackageDescription import

[Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Thiago Negri
I just stumbled upon the Applicative term. Arrows are quite difficult for me to understand at the moment. I guess it needs time to digest. But, as I understand so far, Applicative and Arrows looks like the same thing. Please, enlight me. ___

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread satvik chauhan
Whenever I am confused I refer to this article http://www.haskell.org/haskellwiki/Typeclassopedia#Arrow -Satvik On Fri, Aug 16, 2013 at 7:34 PM, Thiago Negri evoh...@gmail.com wrote: I just stumbled upon the Applicative term. Arrows are quite difficult for me to understand at the moment. I

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Brandon Allbery
On Fri, Aug 16, 2013 at 10:04 AM, Thiago Negri evoh...@gmail.com wrote: I just stumbled upon the Applicative term. Arrows are quite difficult for me to understand at the moment. I guess it needs time to digest. But, as I understand so far, Applicative and Arrows looks like the same thing.

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Tom Ellis
On Fri, Aug 16, 2013 at 10:26:42AM -0400, Brandon Allbery wrote: My understanding is that there's a rework of Arrow in progress that may change this in the future, since *theoretical* Arrows are more distinct, flexible and useful than the current implementation. I'd like to know more about

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Brandon Allbery
On Fri, Aug 16, 2013 at 10:49 AM, Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote: On Fri, Aug 16, 2013 at 10:26:42AM -0400, Brandon Allbery wrote: My understanding is that there's a rework of Arrow in progress that may change this in the future, since *theoretical* Arrows are

Re: [Haskell-cafe] One-element tuple

2013-08-16 Thread Brent Yorgey
On Fri, Aug 16, 2013 at 01:35:22AM +, AntC wrote: There's an annoying inconsistency: (CustId 47, CustName Fred, Gender Male) -- threeple (CustId 47, CustName Fred)-- twople -- (CustId 47)-- oneple not! ()

[Haskell-cafe] Call for participation IFL 2013

2013-08-16 Thread publicityifl
CALL FOR PARTICIPATION 25th SYMPOSIUM ON IMPLEMENTATION AND APPLICATION OF FUNCTIONAL LANGUAGES - IFL 2013 RADBOUD UNIVERSITY NIJMEGEN, THE NETHERLANDS ACM In-Cooperation / ACM SIGPLAN AUGUST 28 - 30 2013 Landgoed Holthurnsche Hof http://ifl2013.cs.ru.nl [program available - late

Re: [Haskell-cafe] Haddock multiple definitions

2013-08-16 Thread Mateusz Kowalczyk
On 16/08/13 11:08, Roman Cheplyaka wrote: * Mateusz Kowalczyk fuuze...@fuuzetsu.co.uk [2013-08-16 08:16:35+0100] In the future, please try with more recent version of GHC. This is no longer a parse error with HEAD or 7.6.3. Uhm, actually there is, with 7.6.3. % cat haddock.hs -- Main

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Dan Burton
You may be interested in this paper: Idioms are oblivious, arrows are meticulous, monads are promiscuous http://homepages.inf.ed.ac.uk/wadler/papers/arrows-and-idioms/arrows-and-idioms.pdf Idioms refers to the Applicative class. To put it briefly, if you have an instance of Arrow, you also have

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Mathijs Kwik
Thiago Negri evoh...@gmail.com writes: I just stumbled upon the Applicative term. Arrows are quite difficult for me to understand at the moment. I guess it needs time to digest. But, as I understand so far, Applicative and Arrows looks like the same thing. Please, enlight me. I would

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Thiago Negri
You just made my day. I was trying to understand these things so hard and couldn't get it. Your analogies were brilliant. I'll read all links/papers posted here to get a deeper understanding of these things. I'll just skip dependently typed stuff for now, heh. Thank you, Thiago. 2013/8/16

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Albert Y. C. Lai
On 13-08-16 03:29 PM, Dan Burton wrote: Idioms are oblivious, arrows are meticulous, monads are promiscuous http://homepages.inf.ed.ac.uk/wadler/papers/arrows-and-idioms/arrows-and-idioms.pdf I much recommend this paper. Underrated, underknown, pinpointing, unifying.

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Dan Burton
Reading that blog post Mathijs linked, I had a big ah-hah moment when I read this: This is why arrow-notation creates two scopes. Between the - - symbols, only values that were in scope before execution of the Arrow are in scope. Outside the - -, values that appear during the execution of the

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread damodar kulkarni
Thanks for this nice analogy and explanation. This brings monad transformers to my mind. without monad transformers, the monads are bit crippled in their applicability (please correct me if I am wrong) and with monad transformers the code becomes to some extent ugly (again, please correct me if I

Re: [Haskell-cafe] Alternative name for return

2013-08-15 Thread Erik Hesselink
On Thu, Aug 15, 2013 at 5:39 AM, Jason Dagit dag...@gmail.com wrote: Also, if anyone wants to look at prior art first, Idris supports applicative brackets. As does she [0]. Erik [0] https://personal.cis.strath.ac.uk/conor.mcbride/pub/she/idiom.html

Re: [Haskell-cafe] llvm on macos

2013-08-15 Thread Anton Nikishaev
Ozgur Akgun ozgurak...@gmail.com writes: Hi. On 10 August 2013 18:20, Brandon Allbery allber...@gmail.com wrote: There may be some support for requesting specific versions from Homebrew. Try `brew versions llvm`. Then, you'll need to run the git checkout command in `brew

Re: [Haskell-cafe] Alternative name for return

2013-08-15 Thread Dag Odenhall
I particularly like she's (her?) syntax for Alternative. Not sure whether or not Idris has that. Applicative tuples would be nice too, something like (|a,b,c|) translating to liftA3 (,,) a b c. And operators too, liftA2 (+) a b as (| a + b |)? On Thu, Aug 15, 2013 at 11:08 AM, Erik Hesselink

Re: [Haskell-cafe] Alternative name for return

2013-08-15 Thread Anton Nikishaev
Simon Peyton-Jones simo...@microsoft.com writes: | Indeed, I wished the 0-ary case would be more alike to the unary | and binary case, cf. | | return f0 | f1 $ a1 | f2 $ a1 * a2 | | What is needed is a nice syntax for idiom brackets. Indeed. I'm quite open to adding

Re: [Haskell-cafe] Alternative name for return

2013-08-15 Thread Tikhon Jelvis
If we're adding applicative brackets, it would be nice to have something like ⦇⦈ as options via UnicodeSyntax. When playing around with She, I found it much easier to read than the ASCII version, especially when I needed to combine them: (|(|a + b|) + (|c * d|)|) ⦇⦇a + b⦈ + ⦇c * d⦈⦈

[Haskell-cafe] ANN: Rlang-QQ-0.0.0.0

2013-08-15 Thread adam vogt
Hello Cafe, I am pleased to announce the first release of Rlang-QQ. You can find it at http://hackage.haskell.org/package/Rlang-QQ-0.0.0.0. The package provides a quasiquoter which makes it easier to call R (http://www.r-project.org/) using values calculated with GHC. Variables in quasiquoter

[Haskell-cafe] Haddock multiple definitions

2013-08-15 Thread jabolopes
Hi, I am using GHC: 6.12.1 Haddock: 2.6.0 and the following does not work with Haddock (GHC is fine!): -- Main -- | Blah blah blah (x, y, z) = (1, 2, 3) $ haddock ... /tmp/Main.hs:2:0: parse error on input `(' Is this a bug? Or it's just not part of Haddock? This seems like an

Re: [Haskell-cafe] llvm on macos

2013-08-15 Thread Carter Schonwald
Just brew install llvm should work fine. The version warning is just the ghc devs beig conservative about what they are committing to supporting given finite resources and llvm changing over time. On Thursday, August 15, 2013, Anton Nikishaev wrote: Ozgur Akgun ozgurak...@gmail.com

Re: [Haskell-cafe] llvm on macos

2013-08-15 Thread Ozgur Akgun
Hi. On 15 August 2013 20:35, Carter Schonwald carter.schonw...@gmail.comwrote: Just brew install llvm should work fine. I wonder what makes you think this is the case. At this moment in time, `brew install llvm` will install llvm-3.3. Using llvm-3.3, I get warnings and errors. Using

Re: [Haskell-cafe] llvm on macos

2013-08-15 Thread Carter Schonwald
Huh. I thought the 3.3 llvm problems only happened when building ghc. Oops. Your absolutely right. Ghc 7.7 does not generate in general, IR that llvm = 3.3 will be happy with. On Thursday, August 15, 2013, Ozgur Akgun wrote: Hi. On 15 August 2013 20:35, Carter Schonwald

Re: [Haskell-cafe] Haddock multiple definitions

2013-08-15 Thread Roman Cheplyaka
In any case, it shouldn't fail with a parse error, since this is valid Haskell. Please file a ticket at http://trac.haskell.org/haddock (but first see if it hasn't been reported before). Roman * jabolo...@google.com jabolo...@google.com [2013-08-15 15:24:23-0400] Hi, I am using GHC:

Re: [Haskell-cafe] Haddock multiple definitions

2013-08-15 Thread jabolopes
Hi, I cannot find a similar ticket, so it seems that no one has filed this issue before. As a general comment, I think this issue is a good example that perhaps docstrings should go in the AST. In any case, I would ask someone with a trac account in Haddock to submit this ticket for me. I

[Haskell-cafe] One-element tuple

2013-08-15 Thread AntC
There's an annoying inconsistency: (CustId 47, CustName Fred, Gender Male) -- threeple (CustId 47, CustName Fred)-- twople -- (CustId 47)-- oneple not! () -- nople (That is, it's annoying if

Re: [Haskell-cafe] One-element tuple

2013-08-15 Thread Ivan Lazar Miljenovic
On 16 August 2013 11:35, AntC anthony_clay...@clear.net.nz wrote: There's an annoying inconsistency: (CustId 47, CustName Fred, Gender Male) -- threeple (CustId 47, CustName Fred)-- twople -- (CustId 47)-- oneple not! ()

Re: [Haskell-cafe] One-element tuple

2013-08-15 Thread Dan Burton
For the consistency you want, `data Oneple a = T a` is the best you can do in Haskell. T(CustId 47) is just one character off from what you actually want to write: (Cust 47). And I presume you want the extra bottom that comes with this, as opposed to just treating values as their own one-tuples.

[Haskell-cafe] Cabal errors...

2013-08-15 Thread Gregory Guthrie
I am trying to run ecliseFP to use with Haskell, but it gives an error: SO I tried to rebuild the buildwrapper rogram to get the update, but it fails as below. Any hints or help on what to do next? I think that from some past problems, that theshadowed problem is from global and usr-local

[Haskell-cafe] second order types

2013-08-14 Thread Patrick Browne
Is a second order type one whose instances (values?) are ordinary types?Are kinds *-* second order types?Is Species without the argument a second order type?But with the argument Species is a first order type?Thanks,Pat-- Elephant and Dog typesdata Elephant = Elephant deriving Showdata  Dog = Dog

Re: [Haskell-cafe] Alternative name for return

2013-08-14 Thread Twan van Laarhoven
On 13/08/13 17:38, Andreas Abel wrote: Indeed, I wished the 0-ary case would be more alike to the unary and binary case, cf. return f0 f1 $ a1 f2 $ a1 * a2 You could always write the above as pure f0 pure f1 * a1 pure f2 * a1 * a2 Twan

[Haskell-cafe] Retrieving Haddock comments with haskell-src-exts

2013-08-14 Thread Mateusz Kowalczyk
I'm writing a small tool to help to analyse Haddock comments in Haskell source files to help me to indicate any potential breakage to documentation in existing source files. Currently I'm doing the parsing with the GHC's ‘parser’ function with Opt_Haddock set and I filter out everything I don't

Re: [Haskell-cafe] Retrieving Haddock comments with haskell-src-exts

2013-08-14 Thread Niklas Broberg
Hi Mateusz, haskell-src-exts is not haddock-aware I'm afraid, so I don't have any real solution for you. The one you mention, i.e. going through the whole parse result and stiching things together manually seems like the best bet if you want to use haskell-src-exts throughout. In the longer run,

Re: [Haskell-cafe] Retrieving Haddock comments with haskell-src-exts

2013-08-14 Thread Mateusz Kowalczyk
On 14/08/13 19:02, Niklas Broberg wrote: Hi Mateusz, haskell-src-exts is not haddock-aware I'm afraid, so I don't have any real solution for you. The one you mention, i.e. going through the whole parse result and stiching things together manually seems like the best bet if you want to use

Re: [Haskell-cafe] Alternative name for return

2013-08-14 Thread Simon Peyton-Jones
| Indeed, I wished the 0-ary case would be more alike to the unary and | binary case, cf. | | return f0 | f1 $ a1 | f2 $ a1 * a2 | | What is needed is a nice syntax for idiom brackets. Indeed. I'm quite open to adding idiom brackets to GHC, if everyone can agree on their

[Haskell-cafe] Haskell Weekly News: Issue 276

2013-08-14 Thread Daniel Santa Cruz
Welcome to issue 276 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the week of August 4 to 10, 2013. Quotes of the Week * AndrazBajt: co-worker = producer of work tasks * Brend: I have created a revolutionary AI from

Re: [Haskell-cafe] Alternative name for return

2013-08-14 Thread Jason Dagit
On Wed, Aug 14, 2013 at 7:54 PM, Simon Peyton-Jones simo...@microsoft.comwrote: | Indeed, I wished the 0-ary case would be more alike to the unary and | binary case, cf. | | return f0 | f1 $ a1 | f2 $ a1 * a2 | | What is needed is a nice syntax for idiom brackets. Indeed.

[Haskell-cafe] ANN: libxkbcommon bindings

2013-08-13 Thread Auke Booij
There's a lot of work nowadays towards replacing the X11 infrastructure. Notably, wayland intends to replace some of the functionality that X.Org now provides, and it uses libxkbcommon to replace the X11 XKB.h keyboard event parsing code (actually it is not a dependency, but it is the de facto

Re: [Haskell-cafe] Diagrams and GTK

2013-08-13 Thread Michael Oswald
Hi Claude, Cairo is thread safe* so you could render the whole thing (if it isn't super huge dimensions) to an image surface in the background thread, then displaying could be a matter of copying the correct part (for scrolling) of the surface to the DrawingArea. Yes, I think I will try this

Re: [Haskell-cafe] Some philosophy (Was: Alternative name for return)

2013-08-13 Thread Andreas Abel
On 09.08.2013 17:44, Jerzy Karczmarczuk wrote: Indiscrete Thoughts by Gian-Carlo Rota, published by Birkhäuser in 1997. Available on the Web. For download or to buy? [This looks very interesting...] -- Andreas AbelDu bist der geliebte Mensch. Theoretical Computer Science, University

Re: [Haskell-cafe] Alternative name for return

2013-08-13 Thread Andreas Abel
On 06.08.2013 10:46, Adam Gundry wrote: On 06/08/13 06:14, J. Stutterheim wrote: Suppose we now have the opportunity to change the name of the `return` function in Monad, what would be a better name for it? (for some definition of better) Rather than proposing a different name, I'm going to

[Haskell-cafe] Reminder: today is the deadline for HIW talk proposals (Haskell Implementor's Workshop)

2013-08-13 Thread Ryan Newton
If you would like to give a talk pertaining to Haskell implementation (including libraries). Please submit a short abstract below. See you in Boston! -Ryan * Call for Talks* ACM SIGPLAN Haskell Implementors' Workshop

[Haskell-cafe] ANN: hspec-smallcheck - SmallCheck support for the Hspec testing framework

2013-08-13 Thread Simon Hengel
Hi, I'm glad to announce SmallCheck support [1] for the Hspec testing framework. A tiny example on how to use it is here: https://github.com/hspec/hspec-smallcheck/blob/master/example/Spec.hs More documentation for Hspec is here: http://hspec.github.io/ Cheers, Simon [1]

Re: [Haskell-cafe] more gtk help

2013-08-13 Thread briand
On Mon, 12 Aug 2013 14:50:43 +0100 Claude Heiland-Allen cla...@mathr.co.uk wrote: Hi Brian, On 12/08/13 03:52, bri...@aracnet.com wrote: ... Couldn't match expected type ... Gtk.on Gtk.exposeEvent glCanvas $ \ _ - putStrLn foo ... I looked up the type of Gtk.on and

Re: [Haskell-cafe] more gtk help

2013-08-13 Thread Brandon Allbery
On Tue, Aug 13, 2013 at 10:45 PM, bri...@aracnet.com wrote: fooBar = do putStrLn foo return True so then I thought, aha!, all I need to do is understand the type of return True and all will be revealed to me. Well, it's this: Control.Monad.Trans.Reader.ReaderT

[Haskell-cafe] ANN: restricted-workers-0.1

2013-08-12 Thread Daniel F
Introducing: restricted-workers library, version 0.1.0. This library provides an abstract interface for running various kinds of workers under resource restrictions. It is being developed as part of the interactive-diagrams project and you can read more about the origins of the library in my GSoC

<    5   6   7   8   9   10   11   12   13   14   >