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

2013-08-20 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 comp

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 vi

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 more

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 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 >

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

[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 repl

[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 soc

[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 to

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 wrote: > On Tue, Aug 20, 2013 at 5:00 PM, David Fox 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 fi

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 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 #-} > import Langu

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 functi

[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 :: T

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 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 when I send a mail to: wxha

[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 $ m

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 wri

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

2013-08-20 Thread Ketil Malde
Richard A. O'Keefe 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 argument. It isn'

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 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 >> wrote: >> The argument for twos-complement, which always puzzled me, is that the other >> systems have two ways to represent ze

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 H

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 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 fix.

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 t

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 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 the wxHaskell user mailing

Re: [Haskell-cafe] One-element tuple

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

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 wrote: > On 20/08/13 11:56, Dag Odenhall wrote: > > Good stuff! > > > > Is there any way, or plans fo

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] [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 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 wrote: > Fellow Hask

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 un

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

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: https://github.co

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

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

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 havi

Re: [Haskell-cafe] llvm on macos

2013-08-20 Thread Dominic Steinitz
Dominic Steinitz 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 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 f

[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-exts