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

2012-09-03 Thread Erik Hesselink
On Tue, Aug 28, 2012 at 6:09 PM, Bryan O'Sullivan b...@serpentine.com wrote: On Mon, Aug 27, 2012 at 10:52 AM, Bryan O'Sullivan b...@serpentine.com wrote: The reason you're seeing build breakage is that the .cabal files of the broken packages were edited in-place without communicating with

Re: [Haskell-cafe] How Type inference work in presence of Functional Dependencies

2012-09-13 Thread Erik Hesselink
I don't know if this is a bug or not, but the translation to type families works: class Foo a where type FooT a :: * instance Foo Int where type FooT Int = Float f :: Int - FooT Int f = undefined g :: Int - Float g = undefined h :: Int - FooT Int h = g You don't even need the class

Re: [Haskell-cafe] Transforming a ADT to a GADT

2012-09-14 Thread Erik Hesselink
On Fri, Sep 14, 2012 at 2:01 PM, Sean Leather leat...@cs.uu.nl wrote: On Fri, Sep 14, 2012 at 12:45 PM, Florian Lorenzen wrote: I'd like to transform a value of an ADT to a GADT. Suppose I have the simple expression language data Exp = Lit Int | Succ Exp | IsZero Exp | If Exp Exp Exp

Re: [Haskell-cafe] Transforming a ADT to a GADT

2012-09-14 Thread Erik Hesselink
On Fri, Sep 14, 2012 at 2:27 PM, Erik Hesselink hessel...@gmail.com wrote: In general, I think you have to work inside an existential. So you hide the type of the parsed Term inside an existential. If you want to apply functions to this Term, you unpack, call the function, and repack. Maybe I

Re: [Haskell-cafe] 64-bit vs 32-bit haskell platform on Mac: misleading notice on Platform website?

2012-09-26 Thread Erik Hesselink
On Wed, Sep 26, 2012 at 10:58 AM, Johan Tibell johan.tib...@gmail.com wrote: On Wed, Sep 26, 2012 at 7:44 AM, Carter Schonwald carter.schonw...@gmail.com wrote: To the best of my knowledge there is absolutely no reason to use the 32bit haskell on OS X (aside from memory usage optimization

Re: [Haskell-cafe] Copying a syntax tree

2012-10-02 Thread Erik Hesselink
You could add {-# LANGUAGE DeriveFunctor #-}, and then add 'deriving Functor' to all your data types (or you could of course manually define your functor instances). Then what you want is just 'fmap show'. Erik On Tue, Oct 2, 2012 at 9:55 AM, Sergey Mironov ier...@gmail.com wrote: Hi! I have a

Re: [Haskell-cafe] ANN: cabal-install-1.16.0 (and Cabal-1.16.0.1)

2012-10-03 Thread Erik Hesselink
On Wed, Oct 3, 2012 at 6:06 PM, Johan Tibell johan.tib...@gmail.com wrote: On the behalf of the many contributors to cabal, I'm proud to present cabal-install-1.16.0. Congratulations and thanks to all those involved! To install: cabal update cabal install cabal-install-1.16.0

Re: [Haskell-cafe] [Security] Put haskell.org on https

2012-10-28 Thread Erik Hesselink
While I would love to have hackage available (or even forced) over https, I think the biggest reason it currently isn't, is that cabal would then also need https support. This means the HTTP library would need https support, which I've heard will be hard to implement cross-platform (read: on

Re: [Haskell-cafe] [Security] Put haskell.org on https

2012-10-28 Thread Erik Hesselink
is perfectly fine. So we could have HTTP for cabal download only and HTTPS for everything else. Best regards, Petr Pudlak 2012/10/28 Erik Hesselink hessel...@gmail.com: While I would love to have hackage available (or even forced) over https, I think the biggest reason it currently

Re: [Haskell-cafe] How to determine correct dependency versions for a library?

2012-11-10 Thread Erik Hesselink
On Fri, Nov 9, 2012 at 5:52 PM, Roman Cheplyaka r...@ro-che.info wrote: * Janek S. fremenz...@poczta.onet.pl [2012-11-09 17:15:26+0100] but I am aware that if the library were to be released on Hackage I would have to supply version numbers in the dependencies. The question is how to

Re: [Haskell-cafe] How to determine correct dependency versions for a library?

2012-11-12 Thread Erik Hesselink
-che.info wrote: * Erik Hesselink hessel...@gmail.com [2012-11-10 16:40:30+0100] On Fri, Nov 9, 2012 at 5:52 PM, Roman Cheplyaka r...@ro-che.info wrote: * Janek S. fremenz...@poczta.onet.pl [2012-11-09 17:15:26+0100] but I am aware that if the library were to be released on Hackage I

Re: [Haskell-cafe] How to determine correct dependency versions for a library?

2012-11-12 Thread Erik Hesselink
On Mon, Nov 12, 2012 at 5:13 PM, Johan Tibell johan.tib...@gmail.comwrote: On Mon, Nov 12, 2012 at 1:06 AM, Erik Hesselink hessel...@gmail.comwrote: tl;dr: Breakages without upper bounds are annoying and hard to solve for package consumers. With upper bounds, and especially with sandboxes

Re: [Haskell-cafe] How to determine correct dependency versions for a library?

2012-11-14 Thread Erik Hesselink
On Wed, Nov 14, 2012 at 10:57 AM, Roman Cheplyaka r...@ro-che.info wrote: * Ivan Lazar Miljenovic ivan.miljeno...@gmail.com [2012-11-14 20:53:23+1100] Doesn't this prevent the error of this package won't build (even if the error message doesn't precisely say that)? Yeah, it replaces one

Re: [Haskell-cafe] local type denotation

2012-11-14 Thread Erik Hesselink
You need to enable ScopedTypeVariables, and add a forall to introduce the type variable at the top level. The local variable will then be the *same* 'a' instead of a fresh one: {-# LANGUAGE ScopedTypeVariables #-} data D a = D1 a | D2 a (a - a) f :: forall a. Eq a = D a - a f (D1 x) =

Re: [Haskell-cafe] Equality test between types that returns type-level Bool ?

2012-11-26 Thread Erik Hesselink
If you're up for it, Oleg has a lot of interesting material about this subject [1]. Regards, Erik [1] http://okmij.org/ftp/Haskell/typeEQ.html On Sun, Nov 25, 2012 at 9:36 AM, Takayuki Muranushi muranu...@gmail.comwrote: Is it possible to write type family SameType a b :: Bool which

Re: [Haskell-cafe] Example programs with ample use of deepseq?

2013-01-09 Thread Erik Hesselink
On Tue, Jan 8, 2013 at 10:54 PM, Joachim Breitner m...@joachim-breitner.de wrote: Am Dienstag, den 08.01.2013, 13:01 -0800 schrieb Evan Laforge: surprisingly, deepseq is not used as much as I thought. http://packdeps.haskellers.com/reverse/deepseq lists a lot of packages, but (after

Re: [Haskell-cafe] Example programs with ample use of deepseq?

2013-01-09 Thread Erik Hesselink
On Wed, Jan 9, 2013 at 2:40 PM, Joachim Breitner m...@joachim-breitner.de wrote: Hi Erik, Am Mittwoch, den 09.01.2013, 14:23 +0100 schrieb Erik Hesselink: We've also used this approach to debug space-leaks, and would have loved such a tool. We used deepseq, and compared the heap profiles. We

Re: [Haskell-cafe] Example programs with ample use of deepseq?

2013-01-11 Thread Erik Hesselink
On Wed, Jan 9, 2013 at 11:38 PM, Joachim Breitner m...@joachim-breitner.de wrote: Am Mittwoch, den 09.01.2013, 15:11 +0100 schrieb Erik Hesselink: We finally solved the problems by completely moving to strict map operations, strict MVar/TVar operations, and strict data types. do you mean

Re: [Haskell-cafe] How to disable document in .cabal file?

2013-01-16 Thread Erik Hesselink
You could do what I do: create an alias in bash. I have in my ~/.bashrc: alias ciq='cabal install --disable-documentation --disable-library-profiling --disable-executable-profiling' The alias 'ciq' stands for 'cabal install quick' and disables things I don't need during development, but do slow

Re: [Haskell-cafe] hxt pickling question

2013-01-24 Thread Erik Hesselink
There's showPickled [0] and unpickleDoc [1], maybe those help? Erik [0] http://hackage.haskell.org/packages/archive/hxt/latest/doc/html/Text-XML-HXT-Arrow-Pickle-Xml.html#v:showPickled [1]

Re: [Haskell-cafe] How far compilers are allowed to go with optimizations?

2013-02-06 Thread Erik Hesselink
On Wed, Feb 6, 2013 at 1:18 PM, Austin Seipp mad@gmail.com wrote: Now, on a slight tangent, in practice, I guess it depends on your target market. C programs don't necessarily expose the details to make such rich optimizations possible. And Haskell programmers generally rely on

Re: [Haskell-cafe] How to input Unicode string in Haskell program?

2013-02-21 Thread Erik Hesselink
You can also set the locale encoding for a handle (e.g. System.IO.stdin) from code using `System.IO.hSetEncoding` [0]. Erik [0] http://hackage.haskell.org/packages/archive/base/latest/doc/html/System-IO.html#v:hSetEncoding On Thu, Feb 21, 2013 at 12:07 PM, Alexander V Vershilov

Re: [Haskell-cafe] ANN: Nomyx 0.1 beta, the game where you can change the rules

2013-02-27 Thread Erik Hesselink
Note that cookies are not the solution here. Cookies are just as user controlled as the url, just less visible. What you need is a session id: a mapping from a non-consecutive, non-guessable, secret token to the user id (which is sequential and thus guessable, and often exposed in urls etc.). It

Re: [Haskell-cafe] How does one create an input handle bound to a string instead of a file?

2013-02-28 Thread Erik Hesselink
Is your parser impure? I would expect a function from String/Text/ByteString to Maybe (SExpr Pos). Then you have no need for a Handle. Regards, Erik On Thu, Feb 28, 2013 at 2:32 PM, John D. Ramsdell ramsde...@gmail.com wrote: I think I wasn't clear about my question. I want something that

Re: [Haskell-cafe] A question about data declaration

2013-03-21 Thread Erik Hesselink
You could use a GADT: {-# LANGUAGE GADTs #-} data T a where C1 :: Int - T Int C2 :: Char - T Char C3 :: T Char - T Char This will allow you to put a C3 in a C3. If you want to prevent that, just invent some other index, something like: {-# LANGUAGE GADTs, EmptyDataDecls #-} data Yes

Re: [Haskell-cafe] Fwd: [Haskell-beginners] Monad instances and type synonyms

2013-04-14 Thread Erik Hesselink
On Sun, Apr 14, 2013 at 9:28 AM, Chris Wong chrisyco+haskell-c...@gmail.com wrote: On Sun, Apr 14, 2013 at 5:10 PM, Christopher Howard christopher.how...@frigidcode.com wrote: type Adjustment a = SaleVariables - a [...] instance Monad Adjustment where (=) = ... return = ...

Re: [Haskell-cafe] Fwd: How to do automatic reinstall of all dependencies?

2013-04-25 Thread Erik Hesselink
I think --reinstall only reinstalls the package you are actually installing, not the dependencies. You could try using a sandboxing tool, like cabal-dev. Then you just do 'cabal-dev install', and when you want to reinstall everything, you do 'rm cabal-dev/' to wipe the sandbox and start over.

Re: [Haskell-cafe] Automating Hackage accounts

2013-06-13 Thread Erik Hesselink
On Thu, Jun 13, 2013 at 4:22 PM, Tobias Dammers tdamm...@gmail.com wrote: On Thu, Jun 13, 2013 at 05:07:38PM +0300, Mihai Maruseac wrote: On Thu, Jun 13, 2013 at 5:02 PM, Tobias Dammers tdamm...@gmail.com wrote: On Thu, Jun 13, 2013 at 09:44:03AM -0400, Andrew Pennebaker wrote: Could we add

Re: [Haskell-cafe] Automating Hackage accounts

2013-06-13 Thread Erik Hesselink
On Thu, Jun 13, 2013 at 4:48 PM, Niklas Hambüchen m...@nh2.me wrote: As for the user account creation and uploading packages you don't own, Hackage 2 (any day now) has fixes for both. Does Hackage 2 have SSL at least for the web interface? I think it should be possible to set that up by

Re: [Haskell-cafe] ANNOUNCE: haskell-names-0.1

2013-06-25 Thread Erik Hesselink
Tom Lokhorst and myself worked on a tool to generate missing imports, both qualified and unqualified, at the Odessa hackathon. We created a working proof of concept [0]. I wasn't aware of fix-imports. Erik [0] https://github.com/haskell-suite/halberd On Tue, Jun 25, 2013 at 6:30 AM, Evan

Re: [Haskell-cafe] Catch multiple exceptions using 'Control.Exception'

2013-07-03 Thread Erik Hesselink
Perhaps you can use `catches` [0]? Erik [0] http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception.html#v:catches On Wed, Jul 3, 2013 at 12:47 PM, Nikita Karetnikov nik...@karetnikov.org wrote: I'm trying to update a package that uses 'Control.OldException' (works

Re: [Haskell-cafe] newbie question about Functional dependencies conflict between instance declarations:.....

2013-07-05 Thread Erik Hesselink
The constraint on an instance never influences which instance is selected. So as far as instance selection goes, 'instance Foo x' and 'instance C x = Foo x' are the same. The constraint is only checked after the instance is selected. Erik On Fri, Jul 5, 2013 at 2:43 PM, Nicholls, Mark

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-10 Thread Erik Hesselink
Hi Michael, We do this as well. In addition to AsyncException, we ignore BlockedIndefinitelyOnSTM, BlockedIndefinitelyOnMVar and Deadlock. I'm not sure you can ignore Timeout, since the type is not exported from System.Timeout. I'm not sure how to classify these, though. They are in some sense

Re: [Haskell-cafe] Correct way to catch all exceptions

2013-07-10 Thread Erik Hesselink
On Wed, Jul 10, 2013 at 10:39 AM, John Lato jwl...@gmail.com wrote: I think 'shouldBeCaught' is more often than not the wrong thing. A whitelist of exceptions you're prepared to handle makes much more sense than excluding certain operations. Some common whitelists, e.g. filesystem exceptions

Re: [Haskell-cafe] TH splicing and recompilation checking

2013-07-16 Thread Erik Hesselink
There is a GHC ticket about implementing a DEPENDS pragma for doing this [0]. There are patches attached, but it looks like it isn't finished yet. Erik [0] http://ghc.haskell.org/trac/ghc/ticket/4900 On Tue, Jul 16, 2013 at 7:41 PM, Johannes Waldmann waldm...@imn.htwk-leipzig.de wrote: Hi.

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-31 Thread Erik Hesselink
On Fri, Jul 26, 2013 at 6:44 PM, Andreas Abel andreas.a...@ifi.lmu.de wrote: mapSnd f = (id *** f) As a very small aside, this is just `second` from Control.Arrow. Erik ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Alternative name for return

2013-08-06 Thread Erik Hesselink
What about `pure`? It's already used in applicative, and has the motivation that it's embedding a pure value in some context. Since I don't know the details of your project, I don't know if you need two names (one for the applicative version, and one for the monadic version). Erik On Tue, Aug 6,

Re: [Haskell-cafe] deriving Data.HashTable - stack overflow

2013-08-08 Thread Erik Hesselink
There is a ticket with discussion and a patch here [0]. Erik [0] http://ghc.haskell.org/trac/ghc/ticket/7633 On Thu, Aug 8, 2013 at 8:11 PM, David Thomas davidleotho...@gmail.com wrote: I do wish there was a compiler-checked way of specifying a minimum complete definition. On Thu, Aug 8,

Re: [Haskell-cafe] Value-weak hash tables in Haskell ?

2013-08-10 Thread Erik Hesselink
I'm not sure, but there are weak pointer [0], though I have never used them. Erik [0] http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-Mem-Weak.html On Sat, Aug 10, 2013 at 7:13 PM, Aleksey Uymanov s9gf4...@gmail.com wrote: Hello, haskellers. Is there any package

Re: [Haskell-cafe] Alternative name for return

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

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-08-23 Thread Erik Hesselink
On Thu, Aug 22, 2013 at 9:23 PM, Mateusz Kowalczyk fuuze...@fuuzetsu.co.uk wrote: 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,

Re: [Haskell-cafe] [Haskell] ANN: Cabal v1.18.0 released

2013-09-16 Thread Erik Hesselink
On Mon, Sep 16, 2013 at 10:16 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Wed, 4 Sep 2013, Johan Tibell wrote: * GHCi support. It's now much easier to use ghci when developing your packages, especially if those packages require preprocessors (e.g. hsc2hs). That's a great

<    1   2