Re: [Haskell-cafe] monoids induced by Applicative/Alternative/Monad/MonadPlus?

2013-08-23 Thread Mario Blažević
See also this thread from two years ago: http://www.haskell.org/pipermail/haskell-cafe/2011-June/091294.html ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Haskell meetups near Lund, Sweden?

2013-08-23 Thread Carlo Hamalainen
Hi, Are there any Haskell or FP meetups near Lund, Sweden? I will be living there from October. Cheers, -- Carlo Hamalainen http://carlo-hamalainen.net ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] definition of the term combinator

2013-08-23 Thread damodar kulkarni
Hello, The word combinator is used several times in the Haskell community. e.g. parser combinator, combinator library etc. Is it exactly the same term that is used in the combinatory logic ? A combinator is a higher-order function that uses *only function application* and earlier defined

Re: [Haskell-cafe] definition of the term combinator

2013-08-23 Thread Jason Dagit
On Fri, Aug 23, 2013 at 9:09 PM, damodar kulkarni kdamodar2...@gmail.comwrote: Hello, The word combinator is used several times in the Haskell community. e.g. parser combinator, combinator library etc. Is it exactly the same term that is used in the combinatory logic ? A combinator is a

Re: [Haskell-cafe] definition of the term combinator

2013-08-23 Thread John Wiegley
Jason Dagit dag...@gmail.com writes: Where can I find a formal and precise definition of the term combinator, A function that uses nothing but its arguments. as a term used by the Haskell community to describe something? I find that Haskellers often use combinator to mean a

Re: [Haskell-cafe] A question about laziness and performance in document serialization.

2013-08-22 Thread Roman Cheplyaka
* Kyle Hanson hanoo...@gmail.com [2013-08-20 18:23:48-0700] So I am not entirely clear on how to optimize for performance for lazy bytestrings. Currently I have a (Lazy) Map that contains large BSON values (more than 1mb when serialized each). I can serialize BSON documents to Lazy

Re: [Haskell-cafe] haskore - lilypond - typesetting?

2013-08-22 Thread Al Matthews
Abjad, which is a Python library, is probably worth study here for its integration and general re-embrace of Lilypond as a compositional tool. http://www.projectabjad.org/ Note that in Lilypond one can define a Scheme function over for example a set of notes. Al Matthews -- http://fatmilktv.com

Re: [Haskell-cafe] Yet Another Forkable Class

2013-08-22 Thread Alberto G. Corona
The paper is very interesting: http://www.cs.indiana.edu/~sabry/papers/exteff.pdf It seems that the approach is mature enough and it is better in every way than monad transformers, while at the same time the syntax may become almost identical to MTL for many uses. I only expect to see the

Re: [Haskell-cafe] Yet Another Forkable Class

2013-08-22 Thread John ExFalso
To be honest I'm not so sure about these effects... Simply the fact that the Member class needs -XOverlappingInstances means that we cannot have duplicate or polymorphic effects. It will arbitrarily pick the first match in the former and fail to compile in the latter case. Furthermore I don't

Re: [Haskell-cafe] Yet Another Forkable Class

2013-08-22 Thread suhorng Y
For the open union used in extensible effects, apart from using the Typeable mechanism, is there a more protected way to implement the open sum type? I managed to modified the Member class given in the paper, but ended up having to use the vague OverlappingInstance. That's not quite what I hope.

[Haskell-cafe] Lifting strictness to types

2013-08-22 Thread Thiago Negri
I've just read the post Destroying Performance with Strictness by Neil Mitchell [1]. One of the comments from an Anonymous says: How hard would it be to lift strictness annotations to type-level? E.g. instead of f :: Int - Int f !x = x + 1 write f :: !Int - Int f x = x + 1 which would have the

Re: [Haskell-cafe] Lifting strictness to types

2013-08-22 Thread Tom Ellis
On Thu, Aug 22, 2013 at 12:51:24PM -0300, Thiago Negri wrote: How hard would it be to lift strictness annotations to type-level? E.g. instead of f :: Int - Int f !x = x + 1 write f :: !Int - Int f x = x + 1 which would have the same effect. At least it would be transparent to the

Re: [Haskell-cafe] Lifting strictness to types

2013-08-22 Thread Thiago Negri
I think Scala has this optional laziness too. The problem with default-strictness is that libraries that are built with no laziness in mind turn up to be too strict. Going from lazy to strict is possible in the client side, but the other way is impossible. 2013/8/22 Tom Ellis

[Haskell-cafe] instance Alternative ZipList

2013-08-22 Thread Stefan Mehner
I had an idea for |instance Alternative ZipList|, which doesn't seem to exist so far. Maybe there just is no need for it. Please tell me what you think. After giving the instance definition I will add some intuition on why this might be useful. Then some words on laws and other conceivable

Re: [Haskell-cafe] Lifting strictness to types

2013-08-22 Thread Bardur Arantsson
On 2013-08-22 18:19, Thiago Negri wrote: I think Scala has this optional laziness too. Indeed, but it's _not_ apparent in types (which can be an issue). Due to the somewhat weird constructor semantics of the JVM it also means you can have immutable values which start out(!) as null and end up

[Haskell-cafe] Hoogle vs Hayoo

2013-08-22 Thread jabolopes
Hi, I noticed Hayoo appears as a link in the toolbox of http://hackage.haskell.org and also that Hayoo seems to display better results than Hoogle. For example, if you search for 'PublicKey' in Hayoo, you will get several results from Hackage libraries, such as, 'crypto-pubkey' and 'crypto-api'.

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-08-22 Thread Mateusz Kowalczyk
On 22/08/13 19:30, jabolo...@google.com wrote: Hi, I noticed Hayoo appears as a link in the toolbox of http://hackage.haskell.org and also that Hayoo seems to display better results than Hoogle. For example, if you search for 'PublicKey' in Hayoo, you will get several results from Hackage

Re: [Haskell-cafe] monoids induced by Applicative/Alternative/Monad/MonadPlus?

2013-08-22 Thread Petr Pudlák
Or, if there are no such definitions, where would be a good place to add them? Petr Dne 08/20/2013 06:55 PM, Petr Pudlák napsal(a): Dear Haskellers, are these monoids defined somewhere? |import Control.Applicative import Data.Monoid newtype AppMonoid m a =AppMonoid (m a) instance

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

2013-08-21 Thread Ketil Malde
fact 0 = 1 fact n = n * fact (n-1) Now I ran it as fact 100 with signature Int - Int and with Integer - Integer In the first case I got 0 in about 3 seconds [...] And if that sounds like a unreal argument, consider representing and storing Graham's number. So, since computers are

[Haskell-cafe] GHC and backwards compatibility

2013-08-21 Thread Henning Thielemann
If you use $ cabal install --constraint=array installed then cabal-install is forced to use the installed version of array. If a package conflicts with this version, then it will report the conflicting packages. ___ Haskell-Cafe mailing list

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

2013-08-21 Thread Rustom Mody
On Wed, Aug 21, 2013 at 11:47 AM, Ketil Malde ke...@malde.org wrote: On a more serious note, I accept that Int (and other limited precision numbers) is a fact of life, and sometimes useful for performance reasons. I would have liked, however, to have a compiler option or some other way to

[Haskell-cafe] PPC binaries for GHC 7.x?

2013-08-21 Thread Rogan Creswick
Does anyone have PPC binaries for GHC 7.x? I've been trying to help a PPC user compile a large haskell application, and it (and it's dependencies) require a newer ghc; the latest ppc binaries we've found are for 6.10, and we have been unable to compile a never ghc from source (6.12 /almost/

Re: [Haskell-cafe] PPC binaries for GHC 7.x?

2013-08-21 Thread Joey Adams
On Wed, Aug 21, 2013 at 4:55 AM, Rogan Creswick cresw...@gmail.com wrote: Does anyone have PPC binaries for GHC 7.x? I've been trying to help a PPC user compile a large haskell application, and it (and it's dependencies) require a newer ghc; the latest ppc binaries we've found are for 6.10,

Re: [Haskell-cafe] PPC binaries for GHC 7.x?

2013-08-21 Thread Rogan Creswick
On Wed, Aug 21, 2013 at 2:29 AM, Joey Adams joeyadams3.14...@gmail.comwrote: What operating system? Oh, I should have specified -- OS X (I'm not certain which version of OS X; probably not particularly new) --Rogan ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Ideas on a fast and tidy CSV library

2013-08-21 Thread Justin Paston-Cooper
Dear All, I now have some example code. I have put it on: http://pastebin.com/D9MPmyVd. vectorBinner is simply of type Vector Int - Int. I am inputting a 1.5GB CSV on stdin, and would like vectorBinner to run over every single record, outputting results as computed, thus running in constant

Re: [Haskell-cafe] Ideas on a fast and tidy CSV library

2013-08-21 Thread Johan Tibell
As I mentioned, you want to use the Streaming (or Incremental) module. As the program now stands the call to `decode` causes 1.5 GB of CSV data to be read as a `Vector (Vector Int)` before any encoding starts. -- Johan On Wed, Aug 21, 2013 at 1:09 PM, Justin Paston-Cooper

[Haskell-cafe] ANN: Google co-sponsoring ZuriHac 2013

2013-08-21 Thread Bas van Dijk
Dear Haskellers, I would like to remind you that the Zurich FP Afternoon (with a keynote by Simon Marlow) is taking place next week (13:00, Thursday, 29 August) and is directly followed by the ZuriHac 2013 Haskell Hackathon [1]. There are still some places available at both events -- you're

[Haskell-cafe] haskore - lilypond - typesetting?

2013-08-21 Thread Johannes Waldmann
I tried using lilypond ( http://www.lilypond.org/ ) for typesetting of sheet music. While the output looks nice, the input language IMHO is quite horrible, because the underlying data/execution model is underspecified. For some parts, it tries to describe the logical structure of the score; but

Re: [Haskell-cafe] haskore - lilypond - typesetting?

2013-08-21 Thread Rustom Mody
On Wed, Aug 21, 2013 at 6:35 PM, Johannes Waldmann waldm...@imn.htwk-leipzig.de wrote: I tried using lilypond ( http://www.lilypond.org/ ) for typesetting of sheet music. While the output looks nice, the input language IMHO is quite horrible, I use musescore. Its got 3 modes on entry a.

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

2013-08-21 Thread Evan Laforge
but Integer is actually (if you're using GMP with your ghc): Yes, that's tolerably well known. You only pay the space overhead when you need it (like Lisp or Smalltalk). But you always pay the time overhead. I thought Integers can't be unboxed, regardless of their magnitude?

Re: [Haskell-cafe] What am I missing? Cycle in type synonym declarations

2013-08-21 Thread Simon Peyton-Jones
GHC tries to typecheck quotations. In this case it's trying to typecheck the declaration type Bar = FooT $t Part of type checking is rejecting recursive type synonyms. Here GHC is rejecting it because it *might* be recursive, depending on how $t is filled in. The trouble is that we

Re: [Haskell-cafe] haskore - lilypond - typesetting?

2013-08-21 Thread Sturdy, Ian
I think the big question is whether you are dealing with music or scores. a .ly file represents not the music, but the music plus typographic annotations (and I find that even lilypond quite often benefits from hints). Most gui programs represent scores, but I think lilypond stands alone in

Re: [Haskell-cafe] haskore - lilypond - typesetting?

2013-08-21 Thread Stephen Tetley
Here's one I did earlier... http://www.flickr.com/photos/44929957@N03/4459628487/lightbox/ This is Haskore implementation of Chick Corea's Child Song 6 rendered to LilyPond - I don't imagine Mr. Corea's publishers will be sending me a takedown request any time soon. There's a lot missing from

Re: [Haskell-cafe] HSpec vs Tasty (was: ANN: hspec-test-framework - Run test-framework tests with Hspec)

2013-08-21 Thread Andrey Chudnov
So is there a high-level comparison of HSpec and tasty? The only difference I've glimpsed so far was that HSpec has a syntactic sugar for describing tests which, honestly, I haven't found very useful. So, could someone write up a quick comparison of the two for the benefit of the folks like me

[Haskell-cafe] Yet Another Forkable Class

2013-08-21 Thread John ExFalso
TLDR: New forkable monad/transformer suggestion http://pastebin.com/QNUVL12v(hpaste is down) Hi, There are a dozen packages on hackage defining a class for monads that can be forked, however none of these are modular enough to be useful in my opinion. In particular the following are not

[Haskell-cafe] Haskell Weekly News: Issue 277

2013-08-21 Thread Daniel Santa Cruz
Welcome to issue 277 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the week of August 11 to 17, 2013. Quotes of the Week * psygnisfive: Seminearring is the task of giving seminars. * Taneb: You know you've made it when

Re: [Haskell-cafe] Yet Another Forkable Class

2013-08-21 Thread oleg
Perhaps effect libraries (there are several to choose from) could be a better answer to Fork effects than monad transformers. One lesson from the recent research in effects is that we should start thinking what effect we want to achieve rather than which monad transformer to use. Using ReaderT or

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

2013-08-21 Thread AntC
Niklas Broberg niklas.broberg at gmail.com writes: Hmm. I see the difficulty here, ... On Wed, Aug 14, 2013 at 8:57 PM, Mateusz Kowalczyk wrote: ... The main problem with this approach is that we get comments (and their SrcLoc) as a separate list. Hi Niklas, Mateusz, It seems that

[Haskell-cafe] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Niklas Broberg
Fellow Haskelleers, I'm pleased to announce the release of haskell-src-exts-1.14.0! * On hackage: http://hackage.haskell.org/package/haskell-src-exts * Via cabal: cabal install haskell-src-exts * git repo: https://github.com/haskell-suite/haskell-src-extshttp://code.haskell.org/haskell-src-exts

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Niklas Hambüchen
Nice! I hope that haskell-suite will eventually become awesome and solve most of our automation-on-Haskell-code needs. Two questions: 1) My most desired feature would be a syntax tree that does not pluck pluck comments out and make me treat them separately. It looks much easier to me to have a

Re: [Haskell-cafe] llvm on macos

2013-08-20 Thread Dominic Steinitz
Dominic Steinitz dominic at steinitz.org writes: Thanks for all the help everyone :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Niklas Broberg
Hi Niklas, 1) My most desired feature would be a syntax tree that does not pluck pluck comments out and make me treat them separately. It looks much easier to me to have a fully descriptive tree and (filter . concatMap) / traverse them out in some way than getting a list of comments and having

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Mateusz Kowalczyk
On 20/08/13 09:48, Niklas Hambüchen wrote: Nice! I hope that haskell-suite will eventually become awesome and solve most of our automation-on-Haskell-code needs. Two questions: 1) My most desired feature would be a syntax tree that does not pluck pluck comments out and make me treat

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Niklas Hambüchen
On 20/08/13 18:19, Niklas Broberg wrote: Sadly not - it's theoretically impossible. The fact that you can put comments literally wherever, means that it's impossible to treat them as nodes of the AST. E.g. f {- WHERE -} x = -- WOULD -- THESE do -- COMMENTS a {- END

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread JP Moresmau
BuildWrapper has some code that tries to link back the comments to the declaration from the AST generated by haskell-src-exts and the comments. See https://github.com/JPMoresmau/BuildWrapper/blob/master/src/Language/Haskell/BuildWrapper/Src.hs. The unit tests provide some samples:

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Sean Leather
On Tue, Aug 20, 2013 at 11:19 AM, Niklas Broberg wrote: On Tue, Aug 20, 2013 at 10:48 AM, Niklas Hambüchen wrote: 2) Have you considered downloading the all-of-Hackage tarball and running haskell-src-exts over it to get a benchmark of how much HSE can already parse of the Haskell code out

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Mateusz Kowalczyk
On 20/08/13 11:02, JP Moresmau wrote: BuildWrapper has some code that tries to link back the comments to the declaration from the AST generated by haskell-src-exts and the comments. See https://github.com/JPMoresmau/BuildWrapper/blob/master/src/Language/Haskell/BuildWrapper/Src.hs. The unit

Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Dag Odenhall
Good stuff! Is there any way, or plans for a way, to parse a file based on its LANGUAGE pragmas? Last I checked e.g. HSP simply enabled all extensions when parsing, which can cause code to be parsed incorrectly in some cases. On Tue, Aug 20, 2013 at 10:15 AM, Niklas Broberg

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread AlanKim Zimmerman
This is not using haskell-src-exts, but the Haskell Refactorer has a structure to keep a parallel tree of tokens indexed by SrcSpan, which attempts to allocate comments to the appropriate point. See https://github.com/alanz/HaRe/blob/master/src/Language/Haskell/Refact/Utils/TokenUtils.hs. It does

Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Mateusz Kowalczyk
On 20/08/13 11:56, Dag Odenhall wrote: Good stuff! Is there any way, or plans for a way, to parse a file based on its LANGUAGE pragmas? Last I checked e.g. HSP simply enabled all extensions when parsing, which can cause code to be parsed incorrectly in some cases. Can you give any

Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Dag Odenhall
Well if you enable TemplateHaskell then code like foo$bar gets a new meaning and if you enable Arrows then proc is a reserved keyword, etc etc. On Tue, Aug 20, 2013 at 1:06 PM, Mateusz Kowalczyk fuuze...@fuuzetsu.co.ukwrote: On 20/08/13 11:56, Dag Odenhall wrote: Good stuff! Is there any

Re: [Haskell-cafe] One-element tuple

2013-08-20 Thread AntC
adam vogt vogt.adam at gmail.com writes: This preprocessor I just threw together doesn't seem to suffers from those issues http://lpaste.net/91967. This kind of approach probably might let you steal T(..) while still allowing `T (..)' to refer to whatever is the original, though I think

Re: [Haskell-cafe] wxHaskell mailinglist

2013-08-20 Thread Henk-Jan van Tuyl
On Mon, 19 Aug 2013 20:18:53 +0200, Nathan Hüsken nathan.hues...@posteo.de wrote: Anyone knows what the proper channel for reporting bugs and asking questions about wxHaskell is? The github page https://github.com/wxHaskell/wxHaskell/wiki seems to have issues disabled, and when I post to

Re: [Haskell-cafe] wxHaskell mailinglist

2013-08-20 Thread Nathan Hüsken
Hey, Then something is wrong. When I try to subscribe here: https://lists.sourceforge.net/lists/listinfo/wxhaskell-users I get a mail: Mailman privacy alert, telling me that I am already subscribed. But when I send a mail to: wxhaskell-us...@lists.sourceforge.net I get a mail: Your message

Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Niklas Broberg
HSE parses based on pragmas by default. This can be configured through the ParseMode [1]. But your question regards HSP, Haskell Server Pages, which indeed just enables most extensions by default. Right now there's no way to configure that, but it shouldn't be hard for a skilled programmer to

Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Niklas Broberg
The first primary reason is technical: haskell-src-exts 1.14 revamps the Extension datatype, among other things to allow turning extensions on and off (similar to what Cabal allows). We also introduce the concept of a Language, separate from a set of extensions. This is the only

Re: [Haskell-cafe] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Dag Odenhall
Wouldn't it be better to only enable Haskell2010 and XmlSyntax and then rely on LANGUAGE pragmas? I guess optimally we want to add support for -Xoptions to hsx2hs but in the mean time… BTW I think hsx2hs is in fact affected by these backwards-incompatible changes, and lacks an upper bound on its

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

2013-08-20 Thread Rustom Mody
On Tue, Aug 20, 2013 at 6:37 AM, Richard A. O'Keefe o...@cs.otago.ac.nz wrote: 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

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

2013-08-20 Thread Ketil Malde
Richard A. O'Keefe o...@cs.otago.ac.nz writes: I think a better argument for twos complement is that you're just doing all of your computations modulo 2^n (where n is 32 or 64 or whatever), and addition and multiplication work as expected modulo anything. To me, that's not a better

Re: [Haskell-cafe] Compiling stringable with GHC 7.0.4

2013-08-20 Thread Ketil Malde
I took the liberty of implementing this fix and uploading stringable-0.1.1.1 to HackageDB. I tested it on GHC 7.0.4 (you know, shipped with the cutting-edge Fedora distribution one year ago, but ancient and no longer to be bothered with by Haskell standards :-) and on 7.6.2. -k Ketil Malde

[Haskell-cafe] monoids induced by Applicative/Alternative/Monad/MonadPlus?

2013-08-20 Thread Petr Pudlák
Dear Haskellers, are these monoids defined somewhere? import Control.Applicativeimport Data.Monoid newtype AppMonoid m a = AppMonoid (m a)instance (Monoid a, Applicative m) = Monoid (AppMonoid m a) where mempty = AppMonoid $ pure mempty mappend (AppMonoid x) (AppMonoid y) = AppMonoid $

Re: [Haskell-cafe] wxHaskell mailinglist

2013-08-20 Thread Henk-Jan van Tuyl
On Tue, 20 Aug 2013 15:24:41 +0200, Nathan Hüsken nathan.hues...@posteo.de wrote: Hey, Then something is wrong. When I try to subscribe here: https://lists.sourceforge.net/lists/listinfo/wxhaskell-users I get a mail: Mailman privacy alert, telling me that I am already subscribed. But

[Haskell-cafe] What am I missing? Cycle in type synonym declarations

2013-08-20 Thread David Fox
This file gives me the error Cycle in type synonym declarations Can anyone tell me why? I'm just trying to write a function to create a type that is a FooT with the type parameter fixed. {-# LANGUAGE TemplateHaskell #-} import Language.Haskell.TH (Q, Dec, TypeQ) data FooT a = FooT a foo ::

Re: [Haskell-cafe] What am I missing? Cycle in type synonym declarations

2013-08-20 Thread jabolopes
Hi, In this case, you have two 'FooT' names: one is the Type and the other is the Constructor. Perhaps Template Haskell is capturing the wrong one inside the quote (probably the constructor). When you have name shadowing, you should always use a lookup function. You can find these lookup

Re: [Haskell-cafe] What am I missing? Cycle in type synonym declarations

2013-08-20 Thread adam vogt
On Tue, Aug 20, 2013 at 5:00 PM, David Fox d...@seereason.com wrote: This file gives me the error Cycle in type synonym declarations Can anyone tell me why? I'm just trying to write a function to create a type that is a FooT with the type parameter fixed. {-# LANGUAGE TemplateHaskell #-}

Re: [Haskell-cafe] What am I missing? Cycle in type synonym declarations

2013-08-20 Thread David Fox
On Tue, Aug 20, 2013 at 2:35 PM, adam vogt vogt.a...@gmail.com wrote: On Tue, Aug 20, 2013 at 5:00 PM, David Fox d...@seereason.com wrote: This file gives me the error Cycle in type synonym declarations Can anyone tell me why? I'm just trying to write a function to create a type that is a

[Haskell-cafe] Looking for ICFP roommate

2013-08-20 Thread Conal Elliott
I'm looking for an ICFP roommate. I plan to attend Sunday through Saturday and stay the nights of Saturday the 21st through Saturday the 28th. I missed the discounted price of $225 (yipes) at the Airport Hilton (sold out). Perhaps someone already has a room reserved with two beds or could switch

[Haskell-cafe] A question about laziness and performance in document serialization.

2013-08-20 Thread Kyle Hanson
So I am not entirely clear on how to optimize for performance for lazy bytestrings. Currently I have a (Lazy) Map that contains large BSON values (more than 1mb when serialized each). I can serialize BSON documents to Lazy ByteStrings using Data.Binary.runPut. I then write this bytestring to a

[Haskell-cafe] ANNOUNCE: posix-paths, for faster file system operations

2013-08-20 Thread Niklas Hambüchen
John Lato and I would like to announce our posix-paths package. https://github.com/JohnLato/posix-paths It implements a large portion of System.Posix.FilePath using ByteString based RawFilePaths instead of String based FilePaths, and on top of that provides a Traversal module with a fast

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Tommy Thorn
+1 When I worked on the font-lock support for haskell-mode, the irony of trying to approximate the classification that the hugs/ghc/whatnot parser was already doing wasn't lost on me. I still would like to tap into more of the knowledge generated and lost in the compiler: - A list of all tokens

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-exts 1.14.0

2013-08-20 Thread Tommy Thorn
On Aug 20, 2013, at 02:19 , Niklas Broberg niklas.brob...@gmail.com wrote: Sadly not - it's theoretically impossible. The fact that you can put comments literally wherever, means that it's impossible to treat them as nodes of the AST. E.g. f {- WHERE -} x = -- WOULD -- THESE

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

2013-08-20 Thread Roman Cheplyaka
My answer to this and many similar questions regarding tasty is: - I am probably not going to work on this - but I would be happy to see someone doing it Note that hspec-test-framework is a separate package, and it didn't have to be written or even approved by Simon. Same here — please write

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

2013-08-20 Thread Richard A. O'Keefe
On 20/08/2013, at 6:44 PM, Kyle Miller wrote: By working as expected I actually just meant that they distribute (as in a(b+c)=ab+ac) and commute (ab=ba and a+b=b+a), That is a tiny fraction of working as expected. The whole modular arithmetic argument would come close to having some virtue,

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

2013-08-19 Thread Nikita Danilenko
Hi, as for the nomenclature - mathematically the pattern f^{-1} . g . f is sometimes called conjugation [1]. One (trivial) type of occurrence is data Foo a = Foo { unFoo :: a } deriving Show instance Functor Foo where fmap f = Foo . f . unFoo The under function from the lens library [2]

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread AntC
Brent Yorgey byorgey at seas.upenn.edu writes: data Oneple a = Oneple a -- (or newtype) (Oneple $ CustId 47) -- too verbose This is what the OneTuple package is for: Thank you Brent, and Ivan made the same suggestion. Apart from

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread Daniel F
Can you please elaborate why this inconsistency is annoying and what's the use of OneTuple? Genuine question, thanks. On Fri, Aug 16, 2013 at 5:35 AM, AntC anthony_clay...@clear.net.nz wrote: There's an annoying inconsistency: (CustId 47, CustName Fred, Gender Male) -- threeple

Re: [Haskell-cafe] ordNub

2013-08-19 Thread AntC
Richard A. O'Keefe ok at cs.otago.ac.nz writes: There are at least four different things that an Ord version might mean: - first sort a list, then eliminate duplicates - sort a list eliminating duplicates stably as you go (think 'merge sort', using 'union' instead of 'merge') -

Re: [Haskell-cafe] One-element tuple

2013-08-19 Thread adam vogt
On Mon, Aug 19, 2013 at 5:40 AM, AntC anthony_clay...@clear.net.nz wrote: ... Would double-parens be too wild an idea?: ... ((CustId 47)) `extend` (CustName Fred, Gender Male) f ((CustId x)) = ... instance C ((CustId Int)) ... We'd have to avoid the double parens as in:

[Haskell-cafe] GHC and backwards compatibility

2013-08-19 Thread Ketil Malde
I recently encountered the following problem: $ cabal install Resolving dependencies... Configuring array-0.4.0.1... Building array-0.4.0.1... Preprocessing library array-0.4.0.1... Data/Array/IArray.hs:1:14:

Re: [Haskell-cafe] GHC and backwards compatibility

2013-08-19 Thread Joe Q
This is definitely an issue with the array package not setting the right minimum versions. You should email the maintainer. On Aug 19, 2013 11:05 AM, Ketil Malde ke...@malde.org wrote: I recently encountered the following problem:

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

2013-08-19 Thread Kyle Miller
On Sun, Aug 18, 2013 at 8:04 PM, Richard A. O'Keefe o...@cs.otago.ac.nzwrote: 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 for bitwise operations, on the B6700. I *did*

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

2013-08-19 Thread Brandon Allbery
On Mon, Aug 19, 2013 at 11:43 AM, Kyle Miller kmill31...@gmail.com wrote: Or, three other options: 1) make MIN_INT outside the domain of abs, 2) make the range of abs be some unsigned int type, or 3) use Integer (i.e., use a type which actually represents integers rather than a type which can

[Haskell-cafe] Errors in non-monadic code

2013-08-19 Thread jabolopes
Hi, What is the proper way to implement a non-monadic function that checks whether a given value is correct and gives a proper error message otherwise ? What is the recommended option ? * Either String a check val | valid val = Right val | otherwise = Left errorMsg * Maybe String check

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

2013-08-19 Thread Daniel F
On Mon, Aug 19, 2013 at 9:48 PM, jabolo...@google.com wrote: Hi, Hello! What is the proper way to implement a non-monadic function that checks whether a given value is correct and gives a proper error message otherwise ? What is the recommended option ? I am not sure, what do you mean

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

2013-08-19 Thread Brandon Allbery
On Mon, Aug 19, 2013 at 1:48 PM, jabolo...@google.com wrote: What is the proper way to implement a non-monadic function that checks whether a given value is correct and gives a proper error message otherwise ? What is the recommended option ? * Either String a Preferred, usually, since

[Haskell-cafe] wxHaskell mailinglist

2013-08-19 Thread Nathan Hüsken
Hey, Anyone knows what the proper channel for reporting bugs and asking questions about wxHaskell is? The github page https://github.com/wxHaskell/wxHaskell/wiki seems to have issues disabled, and when I post to the wxHaskell user mailinglist, it tells me that the list is moderated. But my

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

2013-08-19 Thread jabolopes
Yeah, non-monadic is not the best term... The problem is that it's always so hard to communicate when you want to say a total function that is not in the context of the IO monad. There should be a simple, short name for these functions, so we can easily talk about them. What ends up happening a

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

2013-08-19 Thread Brandon Allbery
On Mon, Aug 19, 2013 at 2:09 PM, Brandon Allbery allber...@gmail.comwrote: Alternatively, have you considered using your own ADT? `data Validity = Success | Failure String` would give you more readable / comprehensible code without needing to worry about assumptions or common usage. Or

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

2013-08-19 Thread Tom Ellis
On Mon, Aug 19, 2013 at 02:20:23PM -0400, jabolo...@google.com wrote: Yeah, non-monadic is not the best term... The problem is that it's always so hard to communicate when you want to say a total function that is not in the context of the IO monad. There should be a simple, short name for

Re: [Haskell-cafe] GHC and backwards compatibility

2013-08-19 Thread Ketil Malde
Joe Q headprogrammingc...@gmail.com writes: This is definitely an issue with the array package not setting the right minimum versions. You should email the maintainer. Yes, that would be the thing to do, except that the maintainer is librar...@haskell.org, whom I believe does not accept

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

2013-08-19 Thread jabolopes
I'd say that if you were in the context of the IO monad, maybe you'd prefer to use exceptions instead of 'Either' or 'Maybe'. Jose On Mon, Aug 19, 2013 at 07:41:48PM +0100, Tom Ellis wrote: On Mon, Aug 19, 2013 at 02:20:23PM -0400, jabolo...@google.com wrote: Yeah, non-monadic is not the best

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

2013-08-19 Thread Brandon Allbery
On Mon, Aug 19, 2013 at 2:59 PM, jabolo...@google.com wrote: I'd say that if you were in the context of the IO monad, maybe you'd prefer to use exceptions instead of 'Either' or 'Maybe'. Even in IO, exceptions should be reserved for truly exceptional conditions (of the program cannot safely

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

2013-08-19 Thread Tobias Dammers
Except that people generally don't seem to agree what constitutes 'exceptional', even when disregarding the python world... On Aug 19, 2013 9:24 PM, Brandon Allbery allber...@gmail.com wrote: On Mon, Aug 19, 2013 at 2:59 PM, jabolo...@google.com wrote: I'd say that if you were in the context

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

2013-08-19 Thread Donn Cave
jabolo...@google.com, MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 In-Reply-To: CAKFCL4VfY-Dz3Xo9ZUZ_SmfRQ2nLGDLbovU=suf1-ssnqvs...@mail.gmail.com References: CAKFCL4VfY-Dz3Xo9ZUZ_SmfRQ2nLGDLbovU=suf1-ssnqvs...@mail.gmail.com quoth Brandon Allbery, Even in IO, exceptions should be

Re: [Haskell-cafe] librar...@haskell.org (was: GHC and backwards compatibility)

2013-08-19 Thread Joe Quinn
On 8/19/2013 2:43 PM, Ketil Malde wrote: Joe Q headprogrammingc...@gmail.com writes: This is definitely an issue with the array package not setting the right minimum versions. You should email the maintainer. Yes, that would be the thing to do, except that the maintainer is

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

2013-08-19 Thread jabolopes
I agree that whether to use exceptions or not is a very debatable subject and it is a grey area. Still, in your Python example, I would like to point out that just because something is common, it does not mean it is the right thing to do. For example, something that some Java programmers were

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

2013-08-19 Thread Tom Ellis
On Mon, Aug 19, 2013 at 05:15:39PM -0400, jabolo...@google.com wrote: But I would like to see more code move away from exceptions and into types like Maybe or Either or other types defined for the particular situation (as some people were suggesting in the beginning of the thread). And the

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

2013-08-19 Thread Patrick Mylund Nielsen
On Mon, Aug 19, 2013 at 5:24 PM, Tom Ellis tom-lists-haskell-cafe-2...@jaguarpaw.co.uk wrote: On Mon, Aug 19, 2013 at 05:15:39PM -0400, jabolo...@google.com wrote: But I would like to see more code move away from exceptions and into types like Maybe or Either or other types defined for the

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

2013-08-19 Thread Jerzy Karczmarczuk
jabolo...@google.com : I would like to see more code move away from exceptions and into types like Maybe or Either or other types defined for the particular situation (as some people were suggesting in the beginning of the thread). And the reason for this it is because when you program against

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

2013-08-19 Thread jabolopes
Some exceptions, e.g. in the traversal of deep structures may be and ARE used as escaping continuations. 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

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