Re: [Haskell-cafe] [Haskell] ANNOUNCE: tardis

2012-08-07 Thread Ben Millwood
On Tue, Aug 7, 2012 at 7:04 AM, Dan Burton danburton.em...@gmail.com wrote: As a side note, since the code base is relatively small, it can also serve as a simple demonstration of how to use a cabal flag in conjunction with CPP to selectively include swaths of code (see Control/Monad/Tardis.hs

Re: [Haskell-cafe] [Haskell] ANNOUNCE: notcpp-0.0.1

2012-04-15 Thread Ben Millwood
On Sun, Apr 15, 2012 at 7:14 PM, Steffen Schuldenzucker sschuldenzuc...@uni-bonn.de wrote: On 04/13/2012 10:49 PM, Ben Millwood wrote: I'm pleased to announce my first genuinely original Hackage package: notcpp-0.0.1! http://hackage.haskell.org/package/notcpp [...] Why

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-meta 0.3

2011-01-04 Thread Ben Millwood
It seems I wasn't subscribed to haskell-cafe so this reply didn't get through (sorry for sending this twice, Felipe). I've now subscribed with delivery turned off for -cafe so if you want me to read a response be sure to address me directly :) On Tue, Jan 4, 2011 at 5:08 AM, Ben Millwood hask

Re: [Haskell-cafe] Re: Monads and Functions sequence and sequence_

2010-10-30 Thread Ben Millwood
The actual, entire, complete definitions of sequence and sequence_ are (or at least, could be): sequence [] = return [] sequence (m:ms) = do x - m xs - sequence ms return (x:xs) -- or, equivalently: sequence' = foldr (liftM2 (:)) (return []) sequence_ [] = return () sequence_

Re: [Haskell-cafe] Package regex-posix-0.94.2 suddenly failed to link

2010-10-30 Thread Ben Millwood
On Sat, Oct 30, 2010 at 11:56 AM, Arnaud Bailly arnaud.oq...@gmail.com wrote: Hello, All of a sudden, the package regex-posix-0.94.2 failed to link after i installed a couple of other packages (http, json). When I try to reinstall it, I got the folowing errors: D:\projets\crete1941cabal

Re: [Haskell-cafe] who's in charge?

2010-10-29 Thread Ben Millwood
On Fri, Oct 29, 2010 at 5:06 AM, Steve Severance st...@medwizard.net wrote: whenever I here any open source community (yeah...everyone not just haskell) tell beginners to contribute a package I always scratch my head with a little bit of wonder. Would you really want a package that someone

Re: [Haskell-cafe] type class design

2010-10-29 Thread Ben Millwood
On Fri, Oct 29, 2010 at 1:33 PM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: Note that the case of (==) and (/=) is slightly different, because not only can (/=) be defined in terms (==), but also the other way around. The default definitions of (==) and (/=) are mutually

Re: [Haskell-cafe] Re: Current thinking on CompositionAsDot issue in haskell prime?

2010-10-28 Thread Ben Millwood
On Thu, Oct 28, 2010 at 11:12 AM, John Smith volderm...@hotmail.com wrote: On 28/10/2010 10:15, Alexander Kjeldaas wrote: Hi haskellers. Reading through the Haskell Prime suggestions, one that caught my eye is the CompositionAsDot issue. I'm especially thinking of the Pro issue: * Paves

Re: [Haskell-cafe] Test command line programs

2010-10-26 Thread Ben Millwood
On Tue, Oct 26, 2010 at 5:11 PM, Dupont Corentin corentin.dup...@gmail.com wrote: Hello again café, I have a command line program that takes input from various handles (actually network sockets) like this: s - hGetLine h etc. I'd like to unit test this. How can I do? If all you ever do

Re: [Haskell-cafe] Haskellers.com skills list moderation?

2010-10-20 Thread Ben Millwood
On Tue, Oct 19, 2010 at 2:32 PM, Michael Snoyman mich...@snoyman.com wrote: Algorithmic Problem Solving I think this needs to go, because I'm really having a hard time imagining any programmer who doesn't do this. High Assurance Software Development This sounds vague to me and/or the same as

Re: [Haskell-cafe] Re: Proving stuff about IORefs

2010-10-17 Thread Ben Millwood
On Sun, Oct 17, 2010 at 11:15 AM, Malcolm Wallace malcolm.wall...@me.com wrote: The problem with the code you originally posted was that it looked like this:  f r = do r' - something           f r'           something else -- this is dead code That is, the computation is non-terminating,

Re: [Haskell-cafe] An interesting paper from Google

2010-10-16 Thread Ben Millwood
On Fri, Oct 15, 2010 at 9:28 PM, Andrew Coppin andrewcop...@btinternet.com wrote: I'm still quite surprised that there's no tool anywhere which will trivially print out the reduction sequence for executing an expression. You'd think this would be laughably easy, and yet nobody has done it yet.

Re: [Haskell-cafe] Pronouncing Curry and currying

2010-10-08 Thread Ben Millwood
On Fri, Oct 8, 2010 at 8:56 AM, Petr Pudlak d...@pudlak.name wrote: thanks for both the explanation (Donn) and the sound sample (Luke). Unfortunately, hurry is pronounced differently in British and US English [1], so again I was a little bit confused :-). But Luke's sound sample made it clear

Re: [Haskell-cafe] Eta-expansion destroys memoization?

2010-10-07 Thread Ben Millwood
On Thu, Oct 7, 2010 at 1:44 PM, Luke Palmer lrpal...@gmail.com wrote: The section works because (a %^)  (for some operator %^) is short for (%^) a and (%^ a) is short for flip (%^) a.  Sections don't expand into lambdas. According to the report they do:

Re: [Haskell-cafe] Coding conventions for Haskell?

2010-09-28 Thread Ben Millwood
On Tue, Sep 28, 2010 at 5:55 AM, Evan Laforge qdun...@gmail.com wrote: I write haskell and python in a proportional font and it hasn't yet let to tabs, so no pain so far :) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Applicative instances for Monads

2010-09-25 Thread Ben Millwood
On Sat, Sep 25, 2010 at 3:01 AM, Gregory Crosswhite gcr...@phys.washington.edu wrote: == import Control.Applicative import Control.Concurrent import Control.Concurrent.MVar newtype AIO a = AIO {unAIO :: IO a} instance

Re: [Haskell-cafe] Problems with installing type-level package

2010-09-19 Thread Ben Millwood
2010/9/19 Николай Кудасов crazy.fiz...@gmail.com: Hi, cafe, I have a stange thing when trying to install type-level package: $ sudo ./Setup.hs configure Configuring type-level-0.2.4... $ sudo ./Setup.hs build Preprocessing library type-level-0.2.4... Building type-level-0.2.4... [1 of 8]

Re: [Haskell-cafe] IO Put confusion

2010-09-16 Thread Ben Millwood
On Wed, Sep 15, 2010 at 12:45 AM, Chad Scherrer chad.scher...@gmail.com wrote: Hello, I need to be able to use strict bytestrings to efficiently build a lazy bytestring, so I'm using putByteString in Data.Binary. But I also need random numbers, so I'm using mwc-random. I end up in the IO Put

Re: [Haskell-cafe] Curious why cabal upgrade parsec not installing latest version

2010-09-16 Thread Ben Millwood
On Thu, Sep 16, 2010 at 4:00 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Because Parsec-3 apparently still has some speed regressions compared to Parsec-2 (I'm not qualified to note whether its design is slow or if you have to use it differently to get good performance out of

Re: [Haskell-cafe] Idea for hackage feature

2010-09-16 Thread Ben Millwood
On Fri, Sep 17, 2010 at 1:44 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 17 September 2010 03:18, Henning Thielemann My suggestion is to move the Unsafe modules to a new package 'unsafe'. Then you can easily spot all dirty packages by looking at reverse dependencies of

Re: [Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Ben Millwood
On Wed, Sep 15, 2010 at 2:11 PM, Kevin Jardine kevinjard...@gmail.com wrote: I do think that defObj(MyType) looks a bit cleaner than $(defObj MyType) I believe as of GHC 6.12 you no longer need the $() around top-level splices. So that would just be: defObj MyType

Re: [Haskell-cafe] Re: Cleaning up threads

2010-09-14 Thread Ben Millwood
On Tue, Sep 14, 2010 at 9:44 PM, Mitar mmi...@gmail.com wrote: Hi! On Tue, Sep 14, 2010 at 9:04 PM, Gregory Collins g...@gregorycollins.net wrote: That's surprising to me -- this is how we kill the Snap webserver (killThread the controlling thread...). Yes. This does work. The only problem

Re: [Haskell-cafe] Do expression definition

2010-09-13 Thread Ben Millwood
On Mon, Sep 13, 2010 at 8:21 AM, Alexander Kotelnikov sa...@myxomop.com wrote: And, also, would it make any difference if do {p - e; stmts}      =       let ok p = do {stmts}    ok _ = fail ...  in e = ok is redefined as e = (\p - do {stmts})? This is the magic that allows pattern-match

Re: [Haskell-cafe] Disable LINE Pragma handling in GHC

2010-09-10 Thread Ben Millwood
On Fri, Sep 10, 2010 at 7:40 AM, JP Moresmau jpmores...@gmail.com wrote: I suppose even using GHC for building and something else (haskell-src-exts?) for code handling would leave us with compilation messages at the wrong place. I don't quite understand your use case so I'm not sure it helps,

[Haskell-cafe] Handling platform- or configuration-specific code (or, my CPP complaints)

2010-09-07 Thread Ben Millwood
Good evening, cafe, Having recently taken on maintenance of a package that depends on template-haskell, I've been in some discussion with users and dependencies of my package about how best to write a library that works with multiple incompatible versions of a dependency. The two main approaches

Re: [Haskell-cafe] How to catch exception within the Get monad (the Binary package)

2010-09-07 Thread Ben Millwood
On Tue, Sep 7, 2010 at 2:45 PM, Dimitry Golubovsky golubov...@gmail.com wrote: unThrow a = unsafePerformIO $ (E.evaluate a = return . Right) `E.catch`                                               (\e - return $ Left e) -- or perhaps the right argument of catch could be just (return . Left)?

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread Ben Millwood
I have only one thing to add to this discussion: On Fri, Sep 3, 2010 at 5:16 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: 2b) Is it OK to promote functions that use a class to being class methods?  When I was discussing this in #haskell several people mentioned that defining

Re: [Haskell-cafe] creating a type based on a string

2010-09-02 Thread Ben Millwood
On Thu, Sep 2, 2010 at 9:31 PM, Andrew U. Frank fran...@geoinfo.tuwien.ac.at wrote: I have a user input (string) and need to select one of two types. depending what the input is. is this possible? data A data B data X n = X String op :: String - X n op a = X a :: X A op b = X b :: X B

[Haskell-cafe] Re: Handling absent maintainers

2010-08-18 Thread Ben Millwood
2010/8/17 Geoffrey Mainland mainl...@eecs.harvard.edu: On 08/17/2010 12:28, Ben Millwood wrote: 2010/8/17 Jonas Almström Duregård jonas.dureg...@gmail.com: Hi, Has there been any progress with this package? Like you I have also tried to contact Matt and like you I have ended up making my own

Re: [Haskell-cafe] A cabal odyssey

2010-08-18 Thread Ben Millwood
On Wed, Aug 18, 2010 at 8:31 AM, Evan Laforge qdun...@gmail.com wrote: I was trying to turn on --global by default user-install: False I think it's not completely a stupid idea to have profiling default off. I personally do not really enjoy the fact that I compile everything three times

[Haskell-cafe] ANNOUNCE: haskell-src-meta 0.1.0

2010-08-18 Thread Ben Millwood
erred on the conservative side. Any other comments on the package in general are appreciated too, since this is the first time I've ever uploaded anything to Hackage. There is a github repository at http://github.com/benmachine/haskell-src-meta if you want to submit patches. Yours sincerely, Ben

Re: [Haskell-cafe] Re: Handling absent maintainers

2010-08-17 Thread Ben Millwood
ahead with my upload. I suppose since there's no reason why I deserve maintainership more than you you could just go ahead and upload your version instead. You can see exactly what I've done at my github repository [2]. Yours, Ben Millwood [1] http://hackage.haskell.org/package/th-lift-0.4 [2] http

Re: [Haskell-cafe] A cabal odyssey

2010-08-17 Thread Ben Millwood
On Mon, Aug 16, 2010 at 8:27 PM, Andrew Coppin andrewcop...@btinternet.com wrote: The amusing part is, if you sudo cabal install so it has permission to put the installed files into place, it then uses root's configuration file instead. *sigh* Well anyway, I managed to work around that. But...

Re: [Haskell-cafe] Unwrapping long lines in text files

2010-08-14 Thread Ben Millwood
On Sat, Aug 14, 2010 at 2:38 AM, michael rice nowg...@yahoo.com wrote: The program below takes a text file and unwraps all lines to 72 columns, but I'm getting an end of file message at the top of my output. How do I lose the EOF? Michael While many other people have shown you why you

Re: [Haskell-cafe] Preview the new haddock look and take a short survey

2010-08-06 Thread Ben Millwood
On Thu, Aug 5, 2010 at 2:35 PM, Dino Morelli d...@ui3.info wrote: One thing I haven't seen anyone else comment on is the width of the new docs. I have a large (26) monitor and use the browser full-screen (with xmonad, so even more screen space). When I load these pages, particularly the

Re: [Haskell-cafe] Re: Handling absent maintainers

2010-08-05 Thread Ben Millwood
On Thu, Aug 5, 2010 at 5:07 AM, Erik de Castro Lopo mle...@mega-nerd.com wrote: The permissiveness of hackage uploads suggests that Hackage needs to start using something like GPG signing and GPG webs of trust. The Debian project has stuff like this in place and I'm sure this community could

Re: [Haskell-cafe] Re: Handling absent maintainers

2010-08-05 Thread Ben Millwood
On Thu, Aug 5, 2010 at 6:38 PM, Ben Millwood hask...@benmachine.co.uk wrote: It's worth mentioning that Hackage accounts aren't just given out for free - one has to specifically request them Er, to clarify, I mean signup can't be automated, because account creation is done by a human

Re: [Haskell-cafe] Re: Handling absent maintainers

2010-08-03 Thread Ben Millwood
On Sun, Jul 18, 2010 at 3:02 AM, Mark Wotton mwot...@gmail.com wrote: I've uploaded haskell-src-meta-mwotton, using the development version. It seems to work fine for my applications. It's a bit of a hack, but I can't think of a better way to do it for now. mark -- A UNIX signature isn't

Re: [Haskell-cafe] Constructor question

2010-07-31 Thread Ben Millwood
On Sat, Jul 31, 2010 at 2:32 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Forcing; it means that the values are evaluated (up to WHNF) before the Complex value is constructed: http://www.haskell.org/ghc/docs/6.12.1/html/users_guide/bang-patterns.html Actually, this isn't a

Re: [Haskell-cafe] Laziness question

2010-07-31 Thread Ben Millwood
On Sat, Jul 31, 2010 at 4:56 PM, michael rice nowg...@yahoo.com wrote: From: http://en.wikibooks.org/wiki/Haskell/Laziness Given two functions of one parameter, f and g, we say f is stricter than g if f x evaluates x to a deeper level than g x Exercises    1. Which is the stricter

Re: [Haskell-cafe] Laziness question

2010-07-31 Thread Ben Millwood
On Sat, Jul 31, 2010 at 5:59 PM, michael rice nowg...@yahoo.com wrote: OK, in f, *length* already knows it's argument is a list. In g, *length* doesn't know what's inside the parens, extra evaluation there. So g is already ahead before we get to what's inside the [] and (). According to the

Re: [Haskell-cafe] Definition of List type?

2010-07-30 Thread Ben Millwood
On Fri, Jul 30, 2010 at 7:50 PM, Gregory Crosswhite gcr...@phys.washington.edu wrote: The reason why this definition never actually appears is because it defines the constructors using operators rather than names, which is not allowed in vanilla Haskell.  (There is an extension,

Re: [Haskell-cafe] Definition of List type?

2010-07-30 Thread Ben Millwood
On Fri, Jul 30, 2010 at 8:54 PM, michael rice nowg...@yahoo.com wrote: Thanks all, Now that I have a (very) rudimentary understanding of Haskell, I figured I'd back up and have a closer (conceptual) look at type definitions to see what they have in common, and just happen to pick Maybe and

Re: [Haskell-cafe] Memory and Threads - MVars or TVars

2010-07-29 Thread Ben Millwood
On Thu, Jul 29, 2010 at 3:49 AM, Eitan Goldshtrom thesource...@gmail.com wrote: Perhaps you guys could help me with Cabal now though? I'm trying to install Orc but it wants base=4.2 and =4.3 and I have 4.1 after installing the latest release of GHC. Cabal won't upgrade the base. It complains

Re: [Haskell-cafe] MonadLib usage

2010-07-19 Thread Ben Millwood
On Sun, Jul 18, 2010 at 5:59 PM, Emil Melnikov emilm...@gmail.com wrote: On 2010, July 18, 23:27 Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: When discussing a similar issue with Manuel Chakravarty, he convinced me that cunning newtype deriving is actually rather bad in practice and

Re: [Haskell-cafe] bug in ghci ?

2010-07-08 Thread Ben Millwood
On Thu, Jul 8, 2010 at 3:45 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: Well, I made the suggestion of emitting a warning on instance declarations without method definitions. That would be comparatively easy to implement (even with an additional check to only emit the warning if the

Re: [Haskell-cafe] Re: Is my code too complicated?

2010-07-05 Thread Ben Millwood
On Mon, Jul 5, 2010 at 2:41 PM, Ertugrul Soeylemez e...@ertes.de wrote: Yes, there is some performance loss because of wrapping/unwrapping, but I think this loss is neglible for most applications.  And I'd ask anyway.  This is a discussion thread after all. =) Pretty much all monad

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: Sifflet visual programming language, release 0.1.7

2010-06-12 Thread Ben Millwood
On Sat, Jun 12, 2010 at 9:05 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: On Saturday 12 June 2010 21:43:25, gdwe...@iue.edu wrote: so I go on declaring in my cabal file that my package depends on P = A.B.C, even though I *might* be using new features of P that wouldn't work with P ==

Re: [Haskell-cafe] Re: GATD and pattern matching

2010-06-11 Thread Ben Millwood
On Fri, Jun 11, 2010 at 12:46 AM, Felipe Lessa felipe.le...@gmail.com wrote:  eqTypeable :: (Typeable a, Eq a, Typeable b, Eq b) = a - b - Bool  eqTypeable x y = case cast y of                     Just y' - x == y'                     Nothing - False ...or indeed: eqTypeable x y = cast x

Re: [Haskell-cafe] Re: Using the ContT monads for early exits of IO ?

2010-06-10 Thread Ben Millwood
On Thu, Jun 10, 2010 at 8:57 PM, Maciej Piechotka uzytkown...@gmail.com wrote: Error monad seems not to be a semantic solution as we exit on success not failure. Which is really why the Either monad should not necessarily have Error associations :) If you forget about the fail method, the

Re: [Haskell-cafe] Re: Problems with Haskell Platform

2010-06-02 Thread Ben Millwood
On Wed, Jun 2, 2010 at 12:37 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Is there a way of making Cabal install dependencies using the system package manager, then? For example, I might ask Cabal to install package A.  Package A depends on B and C.  A package for B can be

Re: [Haskell-cafe] TDD in Haskell

2010-05-25 Thread Ben Millwood
On Tue, May 25, 2010 at 12:36 PM, Ionut G. Stan ionut.g.s...@gmail.com wrote: Oh, and a small off-topic question? Is it considered a good practice to use implicit imports in Haskell? I'm trying to learn from existing packages, but all those import all statements drive me crazy. It's pretty

Re: [Haskell-cafe] Bug with [Double]

2010-05-19 Thread Ben Millwood
On Wed, May 19, 2010 at 10:57 AM, Serguey Zefirov sergu...@gmail.com wrote: PS Rationals: Prelude [1,1+2/3..10] :: [Rational] [1 % 1,5 % 3,7 % 3,3 % 1,11 % 3,13 % 3,5 % 1,17 % 3,19 % 3,7 % 1,23 % 3,25 % 3,9 % 1,29 % 3,31 % 3] Same result. This sounds like a bug to me. The section of the

Re: [Haskell-cafe] GADTs and Scrap your Boilerplate

2010-05-16 Thread Ben Millwood
On Sun, May 16, 2010 at 2:34 AM, Tom Hawkins tomahawk...@gmail.com wrote: I got the GADT data DataBox where   DataBox :: (Show d, Eq d, Data d) = d - DataBox [snip] but I can't figure out how to implement gunfold for DataBox. The error message is Text/XML/Generic.hs:274:23:    

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-09 Thread Ben Millwood
On Sun, May 9, 2010 at 7:27 AM, wren ng thornton w...@freegeek.org wrote: The only examples I can think of where we'd want 'fail'-able patterns are entirely pedagogical (and are insignificantly altered by not using 'fail'-able patterns). I can't think of any real code where it would actually

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-08 Thread Ben Millwood
On Sat, May 8, 2010 at 3:26 AM, John Meacham j...@repetae.net wrote: What counts as unfailable? (x,y) probably,  but what about data Foo = Foo x y If we don't allow it, we add 'magic' to tuples, which is a bad thing, if we do allow it, there are some odd consequences. adding another

Re: [Haskell-cafe] Would it be evil to add deriving Typeable to newtype Q?

2010-05-06 Thread Ben Millwood
On Thu, May 6, 2010 at 4:05 AM, Ivan Miljenovic ivan.miljeno...@gmail.com wrote: Re-CC'ing -cafe: On 6 May 2010 12:54, Leonel Fonseca leone...@gmail.com wrote: I wasn't aware of GeneralizedNewtypeDeriving.  I just edited the source file Language.Haskell.TH.Syntax and left: newtype Q a = Q

Re: [Haskell-cafe] {-# LANGUAGE DeriveApplicative #-} ?

2010-05-06 Thread Ben Millwood
On Thu, May 6, 2010 at 8:55 AM, Pavel Perikov peri...@gmail.com wrote: Hi, list!. Now in 6.12.1 we have DeriveFunctor, DeriveFoldable and DeriveTraversable. This greatly simplifies the reuse structure style of programming. Some structure (not just _data_ structure) got captured in ADT and

Re: [Haskell-cafe] mixing map and mapM ?

2010-05-06 Thread Ben Millwood
On Thu, May 6, 2010 at 11:51 AM, Bill Atkins watk...@alum.rpi.edu wrote: Almost - liftM modificationTime has type Status - IO EpochTime.  Like other IO functions (getLine, putStrLn), it returns an IO action but accepts a pure value (the modification time) ghci :m +Control.Monad

Re: [Haskell-cafe] mixing map and mapM ?

2010-05-06 Thread Ben Millwood
On Thu, May 6, 2010 at 12:37 PM, Bill Atkins watk...@alum.rpi.edu wrote: Just curious: why does getModificationTime take an IO FileStatus rather than a FileStatus? It doesn't. getModificationTime is a pure function (think of it like a record accessor). liftM makes it take IO FileStatus

Re: [Haskell-cafe] Location of library documentation with 6.12.1?

2010-05-01 Thread Ben Millwood
On Sat, May 1, 2010 at 1:41 PM, Roly Perera roly.per...@dynamicaspects.org wrote: I can't for example find Control.Monad.State. I guess I'm missing something obvious about how things are organised? The following places might therefore be of interest: http://hackage.haskell.org/package/mtl

Re: [Haskell-cafe] Location of library documentation with 6.12.1?

2010-05-01 Thread Ben Millwood
On Sat, May 1, 2010 at 3:33 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: You need to know which library they're in. You can use the ghc-pkg tool to do this: $ ghc-pkg find-module Control.Monad.State /usr/lib/ghc-6.12.1/package.conf.d monads-fd-0.0.0.1 mtl-1.1.0.2

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-17 Thread Ben Millwood
On Sat, Apr 17, 2010 at 9:50 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: {-# LANGUAGE OverlappingInstances, [...] but with caution: quicksilver using OverlappingInstances is the haskell equivalent of buying a new car with high safety rating and replacing the air bags with poison gas,

Re: [Haskell-cafe] Functional Dependencies conflicts

2010-04-17 Thread Ben Millwood
On Sun, Apr 18, 2010 at 12:45 AM, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Sonntag 18 April 2010 01:23:07 schrieb Ben Millwood: On Sat, Apr 17, 2010 at 9:50 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: {-# LANGUAGE OverlappingInstances, [...] but with caution: quicksilver

Re: [Haskell-cafe] ghc package problem

2010-04-16 Thread Ben Millwood
On Fri, Apr 16, 2010 at 2:40 PM, Phyx loneti...@gmail.com wrote: So same error. This isn't just limited to HSE though, it can't find packages like random,time etc either. Keeps reinstalling them on every cabal install.

Re: [Haskell-cafe] dependent types

2010-04-12 Thread Ben Millwood
On Sun, Apr 11, 2010 at 10:54 PM, Jason Dagit da...@codersbase.com wrote: Or, you could use witness types: data Vehicle classification = Vehicle { ... } mkCar :: Vehicle Car mkTruck :: Vehicle Truck Then you would export the smart constructors, (mkCar/mkTruck) without exporting the Vehicle

Re: [Haskell-cafe] Re: Haskell.org re-design

2010-04-06 Thread Ben Millwood
On Wed, Apr 7, 2010 at 2:22 AM, Thomas Schilling nomin...@googlemail.com wrote: I have set a maximum width on purpose so that it doesn't degrade too badly on big screens. I've never really trusted this argument - it's not required that the browser window occupy the entire screen, so why not

Re: [Haskell-cafe] Where are the haskell elders?

2010-04-05 Thread Ben Millwood
On Mon, Apr 5, 2010 at 3:35 PM, Kim-Ee Yeoh a.biurvo...@asuhan.com wrote: Something I've noticed is the phenomenon of Help Vampires [1] on this list. Amy Hoy: As soon as an open source project, language, or what- have-you achieves a certain notoriety—its half-life, if you will— they swarm

Re: [Haskell-cafe] Haskell.org re-design

2010-04-01 Thread Ben Millwood
On Fri, Apr 2, 2010 at 12:40 AM, Christopher Done chrisd...@googlemail.com wrote: That's true, it's a nice idea but in practice it's hard to know where to focus. I've gone with a left nav. I've built up the HTML which is cross-browser (ie6/7/8/opera/firefox/safari/chrome compat), still need to

Re: [Haskell-cafe] Haskell.org re-design

2010-04-01 Thread Ben Millwood
On Fri, Apr 2, 2010 at 4:36 AM, Ben Millwood hask...@benmachine.co.uk wrote: The easiest thing to do on visiting the website is read about why Haskell is so great, and where to find out how to use it. Uhm, I meant the easiest thing *should be* reading about... Sorry about

Re: [Haskell-cafe] Re: If wishes were horses...

2010-03-14 Thread Ben Millwood
On Sat, Mar 13, 2010 at 3:19 AM, wren ng thornton w...@freegeek.org wrote: The usual approach I've seen is not to distinguish strict and lazy datatypes, but rather to distinguish strict and lazy functions, e.g. by having two different arrows: (-) for lazy functions and (!-) for strict

Re: [Haskell-cafe] cabal install darcs fails on Mac OS X Snow Leopard

2010-03-07 Thread Ben Millwood
On Sun, Mar 7, 2010 at 3:44 PM, George Colpitts george.colpi...@gmail.com wrote: /usr/bin/hsc2hs: line 16: unexpected EOF while looking for matching `' /usr/bin/hsc2hs: line 17: syntax error: unexpected end of file Sounds like a problem with hsc2hs itself. When I installed ghc on Snow Leopard

Re: [Haskell-cafe] Prelude.undefined

2010-03-03 Thread Ben Millwood
On Wed, Mar 3, 2010 at 6:15 AM, Ivan Miljenovic ivan.miljeno...@gmail.com wrote: On 3 March 2010 16:11, Tom Hawkins tomahawk...@gmail.com wrote: -Wall only complains about shadow bindings, defined but not used, and no type signature.  But no unmatched patterns. Yes it does: one of the options

Re: [Haskell-cafe] how to get a string from file

2010-03-03 Thread Ben Millwood
On Wed, Mar 3, 2010 at 6:30 PM, Thomas DuBuisson thomas.dubuis...@gmail.com wrote: On Wed, Mar 3, 2010 at 10:26 AM, Pradeep Wickramanayake prad...@talk.lk wrote: getItemFile :: IO String This says getItemFile is an action that returns a string.  No arguments. getItemFile test = ... And

Re: [Haskell-cafe] How to understand `|` in this code snippet ?

2010-02-27 Thread Ben Millwood
On Sat, Feb 27, 2010 at 9:29 AM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On Feb 27, 2010, at 04:07 , zaxis wrote: xxxMain = do   timeout - getEnv xxx_TIMEOUT   case timeout of       Just str | [(t, _)] - reads str - do           addTimeout t (hPutStrLn stderr *** TIMEOUT _exit

Re: [Haskell-cafe] datakind declaration

2010-02-25 Thread Ben Millwood
On Tue, Feb 23, 2010 at 1:08 AM, Paul Brauner paul.brau...@loria.fr wrote: Hello, I remember seeing something like typedata T = A | B somewhere, where A and B are type constructors, but I can't find it in the ghc doc. Have I been dreaming or is it some hidden feature ? Paul

Re: [Haskell-cafe] Re: Proper round-trip HughesPJ/Parsec for Doubles?

2010-02-24 Thread Ben Millwood
On Wed, Feb 24, 2010 at 1:24 PM, Christian Maeder christian.mae...@dfki.de wrote: 1. break the line after do (to avoid a layout change when change name or arguments of float' or rename the variable e) You can also break it immediately before do, which I think is sometimes more clear.

Re: [Haskell-cafe] STArray newListArray

2010-02-21 Thread Ben Millwood
2010/2/21 Vojtěch Knyttl kny...@gmail.com: Hello, I am trying to create STArray with newListArray like this: la x y = newListArray ((1,1),(x,y)) [(x'+y') | x' - [1..x], y' - [1..y]] – but it does not work: No instance for (MArray a Field m) Notice that newListArray has a monadic return

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Ben Millwood
On Sun, Feb 21, 2010 at 7:10 PM, Max Bolingbroke batterseapo...@hotmail.com wrote: You might be able to get somewhere by writing a custom main function in C and linking it in. According to http://haskell.org/ghc/docs/latest/html/users_guide/options-phases.html if a lib specified with the -l

Re: [Haskell-cafe] A small oversight

2010-02-20 Thread Ben Millwood
I can't answer your question (about getting minBy into the libraries) but I thought I'd point out some tricks: On Sat, Feb 20, 2010 at 10:47 AM, Andrew Coppin andrewcop...@btinternet.com wrote: Also, constructions like  sortBy (compare `on` foo) must surely be very common. Common enough

Re: [Haskell-cafe] Re: Implementing unionAll

2010-02-18 Thread Ben Millwood
On Thu, Feb 18, 2010 at 8:07 AM, Evan Laforge qdun...@gmail.com wrote: And BTW again, here's something I've occasionally found useful: -- | Handy to merge or sort a descending list. reverse_compare :: (Ord a) = a - a - Ordering reverse_compare a b = case compare a b of    LT - GT    EQ - EQ

Re: [Haskell-cafe] Two GET HTTP requests

2010-02-07 Thread Ben Millwood
On Fri, Feb 5, 2010 at 5:51 PM, Chris Eidhof ch...@eidhof.nl wrote: Approach 2: I installed the 'download-curl' package, and tried again. This seems to fail on the following example: import Network.Curl.Download main = do x - openURI http://haskell.org;           y - openURI

Re: [Haskell-cafe] Multi-Class monadic type?

2010-02-03 Thread Ben Millwood
On Wed, Feb 3, 2010 at 1:10 PM, Alexander Treptow alexander.trep...@googlemail.com wrote: testFunc :: (forall a. Conf a, MonadIO m = m a) - TestType At a guess, this function takes a tuple containing a forall a. Conf a and a MonadIO m = m a, which is not what you meant. As Miguel says, more

Re: [Haskell-cafe] Re: Allowing hyphens in identifiers

2009-12-16 Thread Ben Millwood
On Wed, Dec 16, 2009 at 2:55 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: unCamel :: String - String unCamel ('':cs) = '' : inTag cs unCamel (a:b:c:cs)    | isLower a isUpper b isLower c = a : '_' : toLower b : c : unCamel cs unCamel (a:bs@(b:cs))    | isLower a isUpper b    = a :

Re: [Haskell-cafe] Re: Parallel foldl doesn't work correctly

2009-12-12 Thread Ben Millwood
On Sat, Dec 12, 2009 at 10:08 AM, Maciej Piechotka uzytkown...@gmail.com wrote: If operation is associative it can be done using divide et impera spliting list in half and operating on it pararerlly then split in half etc. I implemented something like this as an exercise:

Re: [Haskell-cafe] Re: Status of TypeDirectedNameResolution proposal?

2009-11-24 Thread Ben Millwood
On Sun, Nov 22, 2009 at 7:13 PM, Ketil Malde ke...@malde.org wrote: E.g. if module Foo.Bar isn't found in Foo/Bar.hs GHC could look in Foo.hs (which would just contain a concatenation of what would currently reside in Foo.hs and Foo/Bar.hs). The obvious question arising here is what if module

Re: [Haskell-cafe] Where is `newTVarIO` defined ?

2009-11-24 Thread Ben Millwood
On Tue, Nov 24, 2009 at 11:11 PM, zaxis z_a...@163.com wrote: I cannot hoogle it. It appears in Pugs: run' (-d:rest)                 = do    info - fmap Just (io $ newTVarIO Map.empty)    let ?debugInfo = info    run' rest Sincerely! - fac n = foldr (*) 1 [1..n] -- View this

Re: Re[Haskell-cafe] cursive to foldr

2009-11-18 Thread Ben Millwood
It looks quite neat to use the Maybe monoid here: import Data.Monoid searchList p = foldr (\x - if p x then mappend (Just [x]) else id) Nothing but it seems that the Maybe Monoid instance keeps this strict. I fiddled with this a bit, and came up with the following: instance (Monoid m) =

Re: [Haskell-cafe] Help Haskell driving Medical Instruments

2009-11-11 Thread Ben Millwood
On Tue, Nov 10, 2009 at 5:04 AM, Philippos Apolinarius phi50...@yahoo.ca wrote: foreign import ccall rs232.h opencport opencport :: CInt - IO () foreign import ccall rs232.h closecport closecport :: CInt - CInt [...] Originally, I had the following line (that did not work properly):

Re: [Haskell-cafe] Medical Instruments - Jason

2009-11-11 Thread Ben Millwood
On Wed, Nov 11, 2009 at 6:00 PM, Philippos Apolinarius phi50...@yahoo.ca wrote:  closecport :: Int - IO Int  closecport n= return (fromIntegral (c_closecport (fromIntegral n))) The return here doesn't do what you think it does - semantically, the value of c_closecport is still considered pure

Re: [Haskell-cafe] Interactive chatbot

2009-11-04 Thread Ben Millwood
Oops, I clicked reply instead of reply to all. Duplicating the message below. I suppose this means someone is going to get two copies of this. Sorry someone! On Thu, Nov 5, 2009 at 12:56 AM, Ben Millwood hask...@benmachine.co.uk wrote: On Wed, Nov 4, 2009 at 10:21 PM, Torsten Otto t-otto-n