Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-11 Thread Erik Hesselink
On Wed, Feb 10, 2010 at 16:59, Jason Dusek jason.du...@gmail.com wrote:  I wonder how many people actually write Haskell,  principally or exclusively, at work? We (typLAB) use Haskell. There's four of us, but only two actually program Haskell, and not exclusively. We also use Javascript in the

Re: [Haskell-cafe] Perform a research a la Unix 'find'

2010-08-22 Thread Erik Hesselink
I've used the FileManip package for this. It works fine for my purposes. I have no idea what the performance is, though, beyond 'good enough not to care at the moment'. Erik On Sun, Aug 22, 2010 at 17:32, Yves Parès limestr...@gmail.com wrote: Hello, I would like to recode in Haskell a piece

Re: [Haskell-cafe] Statically tracking validity - suggestions?

2010-08-31 Thread Erik Hesselink
On Tue, Aug 31, 2010 at 08:24, strejon strej...@yahoo.com wrote: Hello. I'm using Haskell to write a specification for some software. The software uses certificates (standard X.509 certificates) and stores user name information in the Subject's CommonName field. The X.509 standard doesn't

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

2010-09-14 Thread Erik Hesselink
Yes, if you use template haskell, all top level functions and values have to be defined before you use them. Erik On Tue, Sep 14, 2010 at 18:11, Kevin Jardine kevinjard...@gmail.com wrote: Hmm - It seems to work if the code is defined before my main function and not after it. Does this have

Re: [Haskell-cafe] Re: Non-existing types in existential quantification?

2010-10-03 Thread Erik Hesselink
On Sun, Oct 3, 2010 at 14:10, Daniel Fischer daniel.is.fisc...@web.de wrote: On Sunday 03 October 2010 10:43:24, Henning Thielemann wrote: On Sun, 3 Oct 2010, Ben Franksen wrote: Christopher Done wrote: Consider the following program: main = putStrLn $ show $ length [undefined ::

Re: [Haskell-cafe] Systematic treatment of static arguments

2010-10-17 Thread Erik Hesselink
On Sat, Oct 16, 2010 at 21:39, Stephen Tetley stephen.tet...@gmail.com wrote: Hello list The Monad and Applicative instances for functions are equivalent to the respective Reader vesions (I use equivalent along the lines of - operationally the same but without the type distinction / newtype).

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-28 Thread Erik Hesselink
On Wed, Oct 27, 2010 at 23:09, Andrew Coppin andrewcop...@btinternet.com wrote: On 27/10/2010 05:00 PM, John Lato wrote: I am somewhat surprised that all capabilities must be ready for GC; I thought with the parallel GC that wouldn't be necessary.  But I don't know much about GC

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-28 Thread Erik Hesselink
On Thu, Oct 28, 2010 at 19:06, Andrew Coppin andrewcop...@btinternet.com wrote: On 28/10/2010 09:25 AM, Erik Hesselink wrote: On Wed, Oct 27, 2010 at 23:09, Andrew Coppin andrewcop...@btinternet.com  wrote: GHC has a _parallel_ GC implementation, meaning that the GC event runs in parallel

Re: [Haskell-cafe] Non-hackage cabal source

2010-11-03 Thread Erik Hesselink
On Wed, Nov 3, 2010 at 06:49, Tony Morris tonymor...@gmail.com wrote: I am trying to set up an apache server as an additional source to hackage for haskell packages. I have added to my ~/.cabal/config file: remote-repo: myhackage:http://myhackage/packages Shouldn't that be: remote-repo:

Re: Better Records was Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-15 Thread Erik Hesselink
On Fri, Nov 12, 2010 at 22:48, Jonathan Geddes geddes.jonat...@gmail.com wrote: Records do leave quite a bit to be desired. But does anybody actually have a concrete alternative proposal yet? A few months ago I proposed a couple of extensions [1] on -cafe. [snip]  Consider what this would

Re: [Haskell-cafe] About Fun with type functions example

2010-11-18 Thread Erik Hesselink
On Thu, Nov 18, 2010 at 20:17, Arnaud Bailly arnaud.oq...@gmail.com wrote: Hello, I am trying to understand and use the Nat n type defined in the aforementioned article. Unfortunately, the given code does not compile properly: [snip] instance (Nat n) = Nat (Succ n) where  toInt   _ = 1 +

Re: [Haskell-cafe] Why does cabal unnecessarily reinstall dependencies?

2010-11-23 Thread Erik Hesselink
It might be that it both your own package and the dependencies cabal tries to reinstall all depend on some package P. If the dependencies are installed depending on P version 1, but to satisfy all dependencies for your own package, cabal needs them to depend on P version 2, cabal will reinstall

Re: [Haskell-cafe] Transparent identity instances

2010-11-28 Thread Erik Hesselink
On Sun, Nov 28, 2010 at 15:59, Jafet jafet.vi...@gmail.com wrote: But using this instance becomes unwieldy. If using Identity was transparent, eg. if it was a type synonym {-# LANGUAGE TypeSynonymInstances #-} type Identity a = a instance Applicative Identity where   -- something like  

Re: [Haskell-cafe] Storables and Ptrs

2010-12-06 Thread Erik Hesselink
This can be used to call into C code expecting pointer input or output types to great effect: wrapperAroundForeignCode :: InputType - IO OutputType wrapperAroundForeignCode in =  alloca $ \inPtr -  alloca $ outPtr - do    poke inPtr in    c_call inPtr outPtr    peek outPtr There is also

Re: [Haskell-cafe] Missing Functor instances in GHC 7?

2010-12-10 Thread Erik Hesselink
On Fri, Dec 10, 2010 at 09:33, Simon Peyton-Jones simo...@microsoft.com wrote: | Interestingly, if I import only Control.Applicative from within GHCi, it | does not find the instances defined in Control.Monad.Instances although | this module is imported in Control.Applicative. On the other

Re: [Haskell-cafe] handling multiple versions of a data structure

2010-12-17 Thread Erik Hesselink
I've recently been playing with code for versioning data types. It's based on happstacks implementation, but uses type families to make it more modular. I've got some proof of concept code on github [1]. We're also writing a small library based on this at typLAB, which we'll probably release as

Re: [Haskell-cafe] handling multiple versions of a data structure

2010-12-18 Thread Erik Hesselink
the same thing. - jeremy On Dec 17, 2010, at 3:57 AM, Erik Hesselink wrote: I've recently been playing with code for versioning data types. It's based on happstacks implementation, but uses type families to make it more modular. I've got some proof of concept code on github [1]. We're also

Re: [Haskell-cafe] ANNOUNCE: yackage 0.0.0

2010-12-27 Thread Erik Hesselink
There is also the hackage 2.0 code [1]. This can be easily cabal-installed, and added as an extra remote-repo to your .cabal/config file. We've set this up at typLAB [2], and it's working great. Cabal upload doesn't support multiple remote repo's, but we've created a small deployment utility to

Re: [Haskell-cafe] Unknown symbol `__dso_handle' with Template Haskell and wxHaskell

2010-12-27 Thread Erik Hesselink
We had this problem with a binding to a C++ library (through a C wrapper). GHCi and cabal didn't work, but ghc --make did. How are you compiling exactly when you get this error? This is somehow related to TH, without it, at least cabal also works. I'm not sure about GHCi. There's also a relevant

Re: [Haskell-cafe] forcing a type constraint on data

2011-01-02 Thread Erik Hesselink
On Sun, Jan 2, 2011 at 01:37, Mathijs Kwik bluescreen...@gmail.com wrote: The original package http://hackage.haskell.org/packages/archive/reaction-logic/2010.11.17/doc/html/Data-Reactor.html has a constructor function (mkReactor) with exactly the constraints I'm after. However, the constraint

Re: [Haskell-cafe] HaXml installation trouble

2011-01-03 Thread Erik Hesselink
This happens because haskel98-1.1.0.0 can't be built with GHC 6.12, but lacks the proper version constraints to enforce this. If you add '--constraint=haskell98==1.0.*' to your 'cabal install' command, it will probably work. Erik On Mon, Jan 3, 2011 at 01:08, Matthew Fairtlough

Re: [Haskell-cafe] Proposal: Applicative = Monad: Call for consensus

2011-01-24 Thread Erik Hesselink
On Tue, Jan 25, 2011 at 05:13, Ryan Ingram ryani.s...@gmail.com wrote: On Fri, Jan 21, 2011 at 7:58 PM, Casey Hawthorne cas...@istar.ca wrote: uj supplied this: About the discussion putStrLn (readLn + (5 :: Int)).. I'll write it as the following line, importing Control.Applicative main =

Re: [Haskell-cafe] Convert a function to a string of operators?

2011-03-11 Thread Erik Hesselink
On Thu, Mar 10, 2011 at 13:34, Lyndon Maydwell maydw...@gmail.com wrote: Will methods explained here work for boolean expressions? The convenience of defining using specialised datatypes for serialising numeric operations comes from Num being a typeclass. This is not the case for Bool:

Re: [Haskell-cafe] Data.Time.Calendar.Day does not seem to have an instance for Read

2011-03-17 Thread Erik Hesselink
On Thu, Mar 17, 2011 at 07:30, C K Kashyap ckkash...@gmail.com wrote: On Thu, Mar 17, 2011 at 12:30 AM, C K Kashyap ckkash...@gmail.com wrote: Hi, I was wondering if this is a defect - Prelude import Data.Time.Calendar Prelude Data.Time.Calendar read 2011-10-10 :: Day interactive:1:1:

Re: [Haskell-cafe] GHC 7/Cabal request for help

2011-03-24 Thread Erik Hesselink
I've just tested this, and with GHC 7, cabal chooses QuickCheck 2.4, whereas with GHC 6.12, it chooses 2.1. If I specify that 6.12 should choose 2.4 as well, I get the same issue there. This is to be expected, because I don't see the CPP checks you mentioned in Test/QuickCheck/Instances.hs in

Re: [Haskell-cafe] impoosible dependencies

2011-04-21 Thread Erik Hesselink
On Thu, Apr 21, 2011 at 19:25, Rogan Creswick cresw...@gmail.com wrote: It is safe to do this.  You will probably need to specify the full version, since despite being included in the latest haskell platform, cabal-install-0.10.x is in the list of things that cabal won't install automatically.

Re: [Haskell-cafe] Server hosting

2011-05-07 Thread Erik Hesselink
On Sat, May 7, 2011 at 12:38, Andrew Coppin andrewcop...@btinternet.com wrote: On 07/05/2011 09:10 AM, Gregory Collins wrote: Linode. Can't recommend them highly enough. If Linode is really the cheapest that the Internet has to offer, I'm going to need to find a job that pays /significantly/

Re: [Haskell-cafe] Locking, unsafePerformIO and bolt-on thread safety.

2011-05-10 Thread Erik Hesselink
My first thought was to create all of the lookup table lazily, and create a pure top level binding for it. Something like: lookupTable :: [Int] lookupTable = map (\x - unsafePerformIO (create_lookup_table x) `seq` x) [1..] Then on a calculation you would index into this list and pass the result

Re: [Haskell-cafe] Status of Haskell + Mac + GUIs graphics

2011-05-20 Thread Erik Hesselink
On Fri, May 20, 2011 at 20:39, Gregory Crosswhite gcr...@phys.washington.edu wrote: On 5/20/11 8:35 AM, Jeremy O'Donoghue wrote: I would like to suggest, quite seriously, that the Haskell community try to come to a consensus about supporting a single Haskell GUI, with a view to distribution

Re: [Haskell-cafe] SIGSEGV in yieldCapability ()

2011-05-23 Thread Erik Hesselink
On Sun, May 22, 2011 at 15:03, Johannes Waldmann waldm...@imn.htwk-leipzig.de wrote:  I think you should file a bug report with a test case on GHC. I am willing to work on this, but I thought I'd go fishing for some advice first. My program uses: forkIO, STM, and FFI. I've seen something

Re: [Haskell-cafe] Type Constraints on Data Constructors

2011-06-09 Thread Erik Hesselink
On Thu, Jun 9, 2011 at 09:46, DavidA polyom...@f2s.com wrote: I think that's exactly what the original poster is complaining about. As a real- life example, consider data Graph a = Ord a = G [a] [[a]] My intention is that whenever I have a Graph a, I want to be able to use the Ord

Re: [Haskell-cafe] Replacing stdin from within Haskell

2011-06-09 Thread Erik Hesselink
On Thu, Jun 9, 2011 at 13:40, Neil Davies semanticphilosop...@gmail.com wrote: Anyone out there got an elegant solution to being able to fork a haskell thread and replace its 'stdin' ? If you don't mind being tied to GHC you can use hDuplicateTo from GHC.IO.Handle [1]. You can also use dupTo

Re: [Haskell-cafe] Replacing stdin from within Haskell

2011-06-09 Thread Erik Hesselink
On Thu, Jun 9, 2011 at 16:40, Donn Cave d...@avvanta.com wrote: Quoth Erik Hesselink hessel...@gmail.com, On Thu, Jun 9, 2011 at 13:40, Neil Davies semanticphilosop...@gmail.com wrote: Anyone out there got an elegant solution to being able to fork a haskell thread and replace its 'stdin

Re: [Haskell-cafe] Map Monoid instance (was commutative monoid?)

2011-06-25 Thread Erik Hesselink
On Sat, Jun 25, 2011 at 19:07, Evan Laforge qdun...@gmail.com wrote: On Sat, Jun 25, 2011 at 9:00 AM, Jens Blanck jens.bla...@gmail.com wrote: So there's a range of possible Monoid instances for each type, More for some types than for others. For Maybe there are three:  * always take the

Re: [Haskell-cafe] Patterns for processing large but finite streams

2011-07-01 Thread Erik Hesselink
This sound exactly like what attribute grammars, like the system developed at Utrecht University [1], are useful for. Erik [1] http://www.cs.uu.nl/wiki/HUT/AttributeGrammarSystem On Fri, Jul 1, 2011 at 10:54, Eugene Kirpichov ekirpic...@gmail.com wrote: Alexey, your definition of mean does not

Re: [Haskell-cafe] Data.Time

2011-07-02 Thread Erik Hesselink
On Saturday, July 2, 2011, Joe Healy j...@omc-international.com.au wrote: One of the points I found non obvious were the fact that local time is just that. There is no knowledge of the actual timezone in the data type. If you wish to store that, it needs to be stored alongside. Isn't that what

Re: [Haskell-cafe] custom SQL-to-Haskell type conversion in HDBC

2011-08-19 Thread Erik Hesselink
On Fri, Aug 19, 2011 at 07:23, Henry House hajho...@hajhouse.org wrote: Does there exist any sample code or other resources on writing a custom SQL-to-Haskell datatype converter instance for use with HDBC that would be accessible to someone just starting with Haskell? The reason I need this is

Re: [Haskell-cafe] Problem with types

2011-08-19 Thread Erik Hesselink
On Fri, Aug 19, 2011 at 14:06, Anupam Jain ajn...@gmail.com wrote: Hi all, Suppose I have a compound data type - data M o = M (String,o) Now, I can define a function that works for ALL M irrespective of o. For example - f :: M o - M o f (M (s,o)) = M (s++!, o) I can also use this function

Re: [Haskell-cafe] custom SQL-to-Haskell type conversion in HDBC

2011-08-19 Thread Erik Hesselink
On Fri, Aug 19, 2011 at 16:09, Henry House hajho...@hajhouse.org wrote: On Friday, 19 August 2011, Erik Hesselink wrote: Do you really need the precision info about the column, or do you just need the values at the right precision? Because you get the last thing already: Prelude

Re: [Haskell-cafe] custom SQL-to-Haskell type conversion in HDBC

2011-08-19 Thread Erik Hesselink
On Fri, Aug 19, 2011 at 16:53, Henry House hajho...@hajhouse.org wrote: On Friday, 19 August 2011, Erik Hesselink wrote: Why exactly do you need the precision information? Empirical measurements (e.g., sizes of some fields in hectares) are precise only to a certain level of measurement error

Re: [Haskell-cafe] custom SQL-to-Haskell type conversion in HDBC

2011-08-20 Thread Erik Hesselink
On Friday, August 19, 2011, Brandon Allbery allber...@gmail.com wrote: On Fri, Aug 19, 2011 at 11:45, Erik Hesselink hessel...@gmail.com wrote: Note that PostgreSQL also doesn't work with decimals as precision: postgres=# select 1::decimal(4,2) * 1::decimal(4,2); ?column

Re: [Haskell-cafe] Is there any way to parametrize a value update using record syntax?

2011-09-06 Thread Erik Hesselink
2011/9/6 Poprádi Árpád popradi_ar...@freemail.hu: i have a record with a lot of items used in a state monad. data BigData = BigData {                   data1 :: X                 , data2 :: X                -- and so on                } updateData1 :: X - MonadicEnv() updateData1 d = do;

Re: [Haskell-cafe] ANN: cabal-ghci 0.1

2011-09-10 Thread Erik Hesselink
On Fri, Sep 9, 2011 at 22:17, Jason Dagit dag...@gmail.com wrote: On Thu, Sep 8, 2011 at 11:06 PM, Etienne Laurin etie...@atnnn.com wrote: Hello fellow hackers. Here is a helpful package I wrote to ease the development of projects using cabal. It includes a :cabalset ghci command to set

Re: [Haskell-cafe] compiler pragma's

2011-09-10 Thread Erik Hesselink
On Fri, Sep 9, 2011 at 23:41, Vasili I. Galchin vigalc...@gmail.com wrote:    Is there a list of compiler pragmas? Specifically I am looking at how to specify more than one type variable in a class definition. Also I have forgotten the meta syntax for specifying a pragma ... some kind of

Re: [Haskell-cafe] which tags program should I use?

2011-09-26 Thread Erik Hesselink
I use hothasktags [1] which works very well. The only problems are sometimes with obscure extensions, where haskell-src-exts (which hothasktags uses) can't parse the file, but that happens very rarely. Regarding speed: it takes 2-3 s on about 250 source files totaling about 25000 lines on my

Re: [Haskell-cafe] DSL for data definition (e.g. compiling Haskell type defs into Google's protocol buffers type defs)

2011-10-04 Thread Erik Hesselink
On Tue, Oct 4, 2011 at 20:33, Karel Gardas karel.gar...@centrum.cz wrote: data PersonType = Person {        id :: Int        , name :: String        , email :: Maybe String        }        deriving (Show, Data, Typeable) so I have `PersonType' as type constructor and Person as value

Re: [Haskell-cafe] SMP parallelism increasing GC time dramatically

2011-10-10 Thread Erik Hesselink
On Mon, Oct 10, 2011 at 16:44, Tom Thorne thomas.thorn...@gmail.com wrote: thanks! I just tried setting -A32M and this seems to fix the parallel GC problems, I now get a speedup with parallel GC on and performance is the same as passing -qg. I had tried -H before and it only made things worse,

Re: [Haskell-cafe] cabal install: Could not find module `Text.XML.HXT.Arrow'

2011-11-08 Thread Erik Hesselink
This is because hSimpleDB doesn't specify version ranges on its dependencies, when it should. Since hxt changed its module structure going from 9.0 to 9.1, hSimpleDB doesn't build against 9.0. You can try to build it by adding '--constraint=hxt==9.0.\*' after your cabal-install command. You can

Re: [Haskell-cafe] cabal install: Could not find module `Text.XML.HXT.Arrow'

2011-11-08 Thread Erik Hesselink
On Tue, Nov 8, 2011 at 12:16, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 8 November 2011 22:10, Erik Hesselink hessel...@gmail.com wrote: This is because hSimpleDB doesn't specify version ranges on its dependencies, when it should. Since hxt changed its module structure going

Re: [Haskell-cafe] [Haskell] Dutch National FP Day 2012

2011-11-16 Thread Erik Hesselink
On Wed, Nov 16, 2011 at 16:19, Henning Thielemann lemm...@henning-thielemann.de wrote: On Wed, 16 Nov 2011, Sean Leather wrote: (Sent on behalf of Doaitse Swierstra) Despite some last minute changes to the planning we are happy to announce that the next Dutch functional programming day

[Haskell-cafe] Proposed change to mime-mail

2011-11-23 Thread Erik Hesselink
Hi all, I've found and solved a problem with mime-mail, and Michael Snoyman asked me to send a request for feedback to -cafe, so here goes. In short, the issue is with address headers containing 'special' (non-ascii) characters. In mime-mail, these are automatically encoded according to RFC

Re: [Haskell-cafe] (no subject)

2011-11-28 Thread Erik Hesselink
On Mon, Nov 28, 2011 at 23:55, Willem O dub...@hotmail.com wrote: And I added this function: createPoint :: Int - Point createPoint x = Point x When I loaded the file containing all this into ghci and executed 'Vector $ map createPoint [1..5]' the result was '(1, 2, 3, 4, 5)' (without the

Re: [Haskell-cafe] writeFile: commitBuffer: invalid argument (Illegal byte sequence)

2011-12-04 Thread Erik Hesselink
What is the value of your LANG environment variable? Does it still give the error if you set it to e.g. en_US.UTF-8? Erik On Sun, Dec 4, 2011 at 13:12, dokondr doko...@gmail.com wrote: Correct url of a bad string:

Re: [Haskell-cafe] writeFile: commitBuffer: invalid argument (Illegal byte sequence)

2011-12-04 Thread Erik Hesselink
/base/latest/doc/html/System-IO.html#g:23 On Sun, Dec 4, 2011 at 19:13, dokondr doko...@gmail.com wrote: Is there any other way to solve this problem without changing LANG environment variable? On Sun, Dec 4, 2011 at 8:27 PM, Erik Hesselink hessel...@gmail.com wrote: What is the value of your

Re: [Haskell-cafe] How to get a file path to the program invoked?

2011-12-05 Thread Erik Hesselink
The operator / is an alias for `combine`, which the documentation says: Combine two paths, if the second path isAbsolute, then it returns the second. In this case, / is absolute, so it is returned. If you wish to add a trailing path separator, use `addTrailingPathSeparator`. Erik On Mon,

Re: [Haskell-cafe] Converting string to System.Time.ClockTime

2011-12-08 Thread Erik Hesselink
I'm not sure if you really need ClockTime (from old-time), but if you don't, the types from the 'time' package are all parseable with `parseTime` [1]. Erik [1] http://hackage.haskell.org/packages/archive/time/latest/doc/html/Data-Time-Format.html#v:parseTime On Thu, Dec 8, 2011 at 14:16,

Re: [Haskell-cafe] Generating Code

2011-12-09 Thread Erik Hesselink
On Fri, Dec 9, 2011 at 20:45, L Corbijn aspergesoe...@gmail.com wrote: So I'm interested if there are other libraries that are more suitable to the task of generating haskell code for library use, and thus generate 'human readable' exported code (so no TH). I'm also interested in how other

Re: [Haskell-cafe] How hard is it to start a web startup using Haskell?

2011-12-19 Thread Erik Hesselink
At Silk [1] we use Haskell for the backend of our web application. The frontend is Javascript with some functional aspects, and we have a shallow ruby layer as a website (but not for the actual application). Erik [1] http://www.silkapp.com On Mon, Dec 19, 2011 at 11:04, Ivan Perez

Re: [Haskell-cafe] ANNOUNCE: partial-lens 0.0.1

2011-12-21 Thread Erik Hesselink
How does this relate to the Maybe lenses in fclabels [1]? Erik [1] http://hackage.haskell.org/packages/archive/fclabels/1.0.4/doc/html/Data-Label-Maybe.html On Wed, Dec 21, 2011 at 04:54, rocon...@theorem.ca wrote: Do you miss null references from your old imperative programming days? Wish

Re: [Haskell-cafe] Alternative versus Monoid

2011-12-21 Thread Erik Hesselink
On Wed, Dec 21, 2011 at 14:10, Bas van Dijk v.dijk@gmail.com wrote: On 16 December 2011 16:26, Yves Parès limestr...@gmail.com wrote: 1) What about the First type? Do we {-# DEPRECATE #-} it? Personnaly, I'm in favor of following the same logic than Int: Int itself is not a monoid. You

Re: [Haskell-cafe] ANNOUNCE: partial-lens 0.0.1

2011-12-21 Thread Erik Hesselink
On Wed, Dec 21, 2011 at 16:39, rocon...@theorem.ca wrote: On Wed, 21 Dec 2011, Erik Hesselink wrote: How does this relate to the Maybe lenses in fclabels [1]? Erik [1] http://hackage.haskell.org/packages/archive/fclabels/1.0.4/doc/html/Data-Label-Maybe.html It appears to be somewhere

Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-22 Thread Erik Hesselink
I would have compose (probably not called '.') read the same way we read this sentence (and unix pipes) ie left to right. You can use from Control.Arrow for that if you want. Erik ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Spurious pattern match warnings with GADTs

2012-01-12 Thread Erik Hesselink
Type classes are open, so nothing prevents someone from adding an instance 'C0 T1' and calling 't' with constructor 'B', causing a crash due to the missing pattern. Erik On Thu, Jan 12, 2012 at 21:40, Tom Hawkins tomahawk...@gmail.com wrote: Let's say I have: data T0 data T1 data T a where

Re: [Haskell-cafe] Data newtype differences. Today: strictness

2012-01-24 Thread Erik Hesselink
An interesting use case for this is that while data Void = Void Void has infinitely many values (undefined, Void undefined, Void (Void undefined) etc), the newtype version newtype Void = Void Void has only one, bottom. This is a way to define the empty datatype without extensions. Erik

Re: [Haskell-cafe] zlib 0.5.3.2 broken?

2012-02-01 Thread Erik Hesselink
I recently ran into this as well. I found this stack overflow question [1], where Daniel Fischer notes that a proper solution has been found, and it shouldn't be long until it reaches hackage. That was one and a half weeks ago. Erik [1]

Re: [Haskell-cafe] Cabal-1.10.1.0 and bytestring-0.9.2.1 hackage problem.

2012-02-03 Thread Erik Hesselink
Same workaround as last time works I.e:  tar -f ~/.cabal/packages/hackage.haskell.org/00-index.tar --delete bytestring/0.9.2.1 This will only work until the next 'cabal update', right? Does anyone have a better workaround? This is the cabal-install shipped with Ubuntu 12.04 (i.e. the

Re: [Haskell-cafe] Concurrency strategy for 2 threads and rare events

2012-02-08 Thread Erik Hesselink
You could use throwTo to raise an exception in the thread you want to stop. Otherwise, having some variable (IORef, TVar, MVar) that the long running thread occasionally checks seems like a good solution. Erik On Wed, Feb 8, 2012 at 17:04, JP Moresmau jpmores...@gmail.com wrote: Hello, I'm

Re: [Haskell-cafe] Failing to find a function

2012-02-19 Thread Erik Hesselink
Not a single name, but I believe liftA2 mplus is the same function, and much shorter (and more general). It uses the Applicative instance for (a -). Of course, it also works with liftM2. Erik On Sun, Feb 19, 2012 at 12:50, Jon Fairbairn jon.fairba...@cl.cam.ac.uk wrote: This is probably a

Re: [Haskell-cafe] Is there a better way to subtyping?

2012-03-14 Thread Erik Hesselink
However, be aware that aFields, bFields and cFields are now partial functions that will crash when applied to the wrong constructor. Not a-okay in my book. Erik On Wed, Mar 14, 2012 at 02:24, John Meacham j...@repetae.net wrote: Why not data Super        = SuperA {                

Re: [Haskell-cafe] ANN: Haskell Platform Versions Comparison Chart

2012-03-18 Thread Erik Hesselink
On Sun, Mar 18, 2012 at 20:28, Simon Hengel s...@typeful.net wrote: **  Not really suer about Mac OS X, but I think it requires Xcode, can    someone confirm this. Yes, the platform on Mac OS X requires Xcode, which includes gcc. Erik ___

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Erik Hesselink
On Mon, Mar 26, 2012 at 21:24, Antoine Latter aslat...@gmail.com wrote: On Mon, Mar 26, 2012 at 1:33 PM, Ting Lei tin...@hotmail.com wrote: Hi, I was writing a code trying to use MonadPlus to detect some error cases (representing missing values etc. in pure code). With the Maybe monad, I can

Re: [Haskell-cafe] Generalizing (++) for monoids instead of using ()

2012-04-02 Thread Erik Hesselink
See the relevant trac ticket [1] and the linked mailing list thread. Erik [1] http://hackage.haskell.org/trac/ghc/ticket/3339 On Sun, Apr 1, 2012 at 22:58, aditya bhargava bluemangrou...@gmail.com wrote: After asking this question:

Re: [Haskell-cafe] strange GHCi type inference behavior involving map and partially applied functions

2012-04-15 Thread Erik Hesselink
GHCi is defaulting the 'a' in 'Show a' to unit because of the extended defaulting feature [1] in GHCi. If you turn on NoMonomorphismRestriction in GHCi, you get the same behavior as in GHC. If you turn on ExtendedDefaulting in GHC, you get the same behavior as in GHCi. Erik [1]

Re: [Haskell-cafe] Embed Haskell

2012-04-22 Thread Erik Hesselink
Hi Rosario, lhs2tex [1] has the '\eval' command. See section 12 of the manual. Erik [1] http://www.andres-loeh.de/lhs2tex/ On Sun, Apr 22, 2012 at 17:59, Rosario Borda rosario.bo...@sinervis.com wrote: Hi All, Is there a simple method for embed haskell in other languages, like latex? An

Re: [Haskell-cafe] Using promoted lists

2012-06-07 Thread Erik Hesselink
If you want to get rid of the overlap in your type families, you have to add an extra argument indicating if the two types are equal. For this, you need a type family to indicate equality of types. Sadly, the naive implementation (TEQ x x = True, TEQ x y = False) overlaps and isn't allowed. I'm

Re: [Haskell-cafe] Using promoted lists

2012-06-08 Thread Erik Hesselink
Hi Yves, The type level numbers have kind Nat, not Int (and so also can't be negative). They have to be imported from GHC.TypeLits (I'm not sure if this will change). So the following code works for me in HEAD: {-# LANGUAGE TypeFamilies, DataKinds #-} import GHC.TypeLits type family Something

Re: [Haskell-cafe] ByteString.getContents fails for files 2GB on OS X

2012-06-08 Thread Erik Hesselink
Do you have a 32bit or 64bit GHC build? That might have something to do with it, if you're nearing 2^32 (or 2^31) bytes. Erik On Fri, Jun 8, 2012 at 2:25 AM, Shaun Jackman sjack...@gmail.com wrote: Hi, Data.ByteString.Char8.getContents fails for files 2GB on OS X. Is there a fix for this?

Re: [Haskell-cafe] how to check thunk

2012-07-02 Thread Erik Hesselink
There is also the 'isevaluated' package (which depends on vacuum, but seems to do something more involved than your code). Erik On Mon, Jul 2, 2012 at 7:40 AM, Chaddaï Fouché chaddai.fou...@gmail.com wrote: On Mon, Jul 2, 2012 at 5:29 AM, Kazu Yamamoto k...@iij.ad.jp wrote: Hello, Are there

Re: [Haskell-cafe] Solutions for multi-platform compilation?

2012-07-12 Thread Erik Hesselink
We use Jenkins to build our applications. You can have Jenkins slaves for different platforms. We also use cabal-dev to sandbox the builds, separating the environments for different executables. This solution does require one server for every OS you develop for, but I guess you need that anyway,

Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5

2012-07-18 Thread Erik Hesselink
On Wed, Jul 18, 2012 at 10:19 AM, Ross Paterson r...@soi.city.ac.uk wrote: On Wed, Jul 18, 2012 at 06:50:31AM +0100, Andres Löh wrote: Using --avoid-reinstalls blindly or as a default flag is also unfortunately not a good idea in general. There are simply too many cases where installing older

Re: [Haskell-cafe] Fwd: hackage compile failure with QuickCheck 2.5

2012-07-18 Thread Erik Hesselink
On Wed, Jul 18, 2012 at 11:29 AM, Ross Paterson r...@soi.city.ac.uk wrote: On Wed, Jul 18, 2012 at 09:35:52AM +0100, Erik Hesselink wrote: I don't think you can install this package on 7.4. As Andres said, it requires containers 0.5, but ghc 7.4's base libraries (in this case, template-haskell

[Haskell-cafe] Cabal install fails due to recent HUnit

2012-07-18 Thread Erik Hesselink
Hi all, All cabal installs using cabal-install-0.10.2 are currently failing for us. This is due to the cabal file for HUnit-1.2.5.0, which was recently uploaded to hackage. The ouput I'm getting from cabal is just: Reading available packages... Resolving dependencies... cabal: Couldn't read

Re: [Haskell-cafe] Cabal install fails due to recent HUnit

2012-07-18 Thread Erik Hesselink
. Cheers, Martijn Schrage -- Oblomov Systems (http://www.oblomov.com) On 18-07-12 16:26, Erik Hesselink wrote: Hi all, All cabal installs using cabal-install-0.10.2 are currently failing for us. This is due to the cabal file for HUnit-1.2.5.0, which was recently uploaded to hackage

Re: [Haskell-cafe] Cabal install fails due to recent HUnit

2012-07-23 Thread Erik Hesselink
On Monday, July 23, 2012, Simon Hengel wrote: On Mon, Jul 23, 2012 at 12:51:32PM -0500, Stephen Paul Weber wrote: Currently you would have to do the upgrade manually, as `cabal-install cabal-install` won't work (or alternatively edit your local

Re: [Haskell-cafe] GHC rendering of non-ASCII characters configurable?

2012-08-01 Thread Erik Hesselink
On Wed, Aug 1, 2012 at 2:35 AM, Richard Cobbe co...@ccs.neu.edu wrote: Well, I initially went with String because I didn't want to clutter up my code with all of the calls to 'pack', especially around string literals. I'm open to being convinced that it's worth it to switch, though. For string

Re: [Haskell-cafe] What Haskell Records Need

2012-08-02 Thread Erik Hesselink
Isn't this exactly the problem solved by all the lens packages? Current popular ones are fclabels [0] and data-lens [1]. [0] http://hackage.haskell.org/package/fclabels [1] http://hackage.haskell.org/package/data-lens On Thu, Aug 2, 2012 at 7:34 AM, Jonathan Geddes geddes.jonat...@gmail.com

Re: [Haskell-cafe] What Haskell Records Need

2012-08-02 Thread Erik Hesselink
On Thu, Aug 2, 2012 at 12:30 PM, Andrew Butterfield andrew.butterfi...@scss.tcd.ie wrote: On 2 Aug 2012, at 09:25, Erik Hesselink wrote: Isn't this exactly the problem solved by all the lens packages? Current popular ones are fclabels [0] and data-lens [1]. [0] http://hackage.haskell.org

Re: [Haskell-cafe] Flipping type constructors

2012-08-18 Thread Erik Hesselink
The next version of GHC will have an extension for kind polymorphism. I'm not sure if it has to be enabled in the module that defines flip or in the module that uses it, but it might help. Erik On Tue, Aug 14, 2012 at 1:38 AM, Tony Morris tonymor...@gmail.com wrote: I have a data-type that is

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-20 Thread Erik Hesselink
I am strongly against this, especially for packages in the platform. If you fail to specify an upper bound, and I depend on your package, your dependencies can break my package! For example, say I develop executable A and I depend on library B == 1.0. Library B depends on library C = 0.5 (no

Re: [Haskell-cafe] fclabels 0.5

2012-08-20 Thread Erik Hesselink
Untested, but this should be about right: osi (Bij f b) = iso (Bij b f) Erik On Mon, Aug 20, 2012 at 2:35 PM, Sergey Mironov ier...@gmail.com wrote: Hi. I'm porting old code, which uses fclabels 0.5. Old fclabels define Iso typeclass as follows: class Iso f where iso :: a :-: b - f a - f

Re: [Haskell-cafe] Platform Versioning Policy: upper bounds are not our friends

2012-08-20 Thread Erik Hesselink
, but if you want to insulate yourself from package upgrades surely sticking with proven combinations is the way to go. Chris -Original Message- From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Erik Hesselink Sent: 20 August 2012 08:33 To: Bryan

Re: [Haskell-cafe] Rigid skolem type variable escaping scope

2012-08-22 Thread Erik Hesselink
On Wed, Aug 22, 2012 at 10:13 PM, Matthew Steele mdste...@alum.mit.edu wrote: On Aug 22, 2012, at 3:02 PM, Lauri Alanko wrote: Quoting Matthew Steele mdste...@alum.mit.edu: {-# LANGUAGE Rank2Types #-} class FooClass a where ... foo :: (forall a. (FooClass a) = a - Int) - Bool

Re: [Haskell-cafe] How to implement instance of MonadBaseControl IO

2012-08-24 Thread Erik Hesselink
I'm not sure if you already have something working, but we have several in our codebase, all following a similar pattern. For example: newtype GeoServer a = GeoServer { unGeoServer :: ReaderT GeoServerState (ServerPartT IO) a } instance MonadBaseControl IO GeoServer where newtype StM GeoServer

Re: [Haskell-cafe] map over Bijections

2012-08-27 Thread Erik Hesselink
If you remove the second argument (which you don't use), you have the function `liftBij` that is in fclabels. Erik On Mon, Aug 27, 2012 at 3:55 PM, Sergey Mironov ier...@gmail.com wrote: Hi. I need map equivalent for Bijection type which is defined in fclabels: data Bijection (~) a b = Bij {

Re: [Haskell-cafe] Cabal install fails due to recent HUnit

2012-08-27 Thread Erik Hesselink
On Mon, Jul 30, 2012 at 3:33 PM, Ross Paterson r...@soi.city.ac.uk wrote: On Mon, Jul 30, 2012 at 01:46:24PM +0100, Niklas Broberg wrote: On Wed, Jul 25, 2012 at 12:22 PM, Ross Paterson r...@soi.city.ac.uk wrote: As I understand it, the plan is to modify the following packages in

Re: [Haskell-cafe] Cabal install fails due to recent HUnit

2012-08-27 Thread Erik Hesselink
On Mon, Aug 27, 2012 at 7:52 PM, Bryan O'Sullivan b...@serpentine.com wrote: On Mon, Aug 27, 2012 at 9:57 AM, Erik Hesselink hessel...@gmail.com wrote: I'm seeing this again, on abstract-deque-0.1.6. Ross, can you fix it again? Hang on a second. The reason you're seeing build breakage

Re: [Haskell-cafe] Build regressions due to GHC 7.6

2012-08-30 Thread Erik Hesselink
On Thu, Aug 30, 2012 at 7:26 AM, Bryan O'Sullivan b...@serpentine.com wrote: The FFI now requires constructors to be visible, so CInt has to be imported as CInt(..). I think there was already a warning about this one in GHC 7.4, so there was more time to fix it. Not to say I don't feel your

Re: [Haskell-cafe] Build regressions due to GHC 7.6

2012-08-30 Thread Erik Hesselink
Note that this does not work if you want to support multiple versions of GHC, and might not work in general, since * The hiding of catch is needed for preludes that still have it, since otherwise it will probably conflict with the one from Control.Exception. * Older versions do not have

Re: [Haskell-cafe] Build regressions due to GHC 7.6

2012-08-30 Thread Erik Hesselink
On Thu, Aug 30, 2012 at 7:24 PM, wren ng thornton w...@freegeek.org wrote: On 8/30/12 10:26 AM, Erik Hesselink wrote: * Packages might not work with the new bytestring version, since the API has breaking changes (although they're supposed to be minor). For the first two, you need to add some

Re: [Haskell-cafe] happstack simpleHTTP state monad

2012-08-30 Thread Erik Hesselink
The way you wrote it, you run the state transformer once for each request. So the state will be available within a single request, but not between requests. If you want to persist state between requests, you can use one the the mutable variables available (TVar or MVar are good choices; IORefs

  1   2   >