Re: Pin a package?

2013-01-12 Thread wagnerdm
Quoting Shachaf Ben-Kiki : You can put "constraint: bytestring == version" in ~/.cabal/config. Alternatively you can run one `cabal install --constraint "bytestring == version"` command. Keep in mind the following subtle difference between this constraint and the "installed" constraint: this

Re: Pin a package?

2013-01-12 Thread wagnerdm
Quoting Stephen Paul Weber : Is there a way to tell cabal to refuse to upgrade a package? I'd like to pin my `bytestring` to the version that shipped with my GHC. cabal install --constraint "bytestring installed" ~d ___ Glasgow-haskell-users mail

Re: Unexpected ambiguity in a seemingly valid Haskell 2010 program

2012-11-09 Thread wagnerdm
It's possible that the below blog post is related. ~d http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7 Quoting Roman Cheplyaka : For this module module Test where import System.Random data RPS = Rock | Paper | Scissors deriving (Show, Enum) instance Random R

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-07 Thread wagnerdm
Quoting Jonas Almström Duregård : Couldn't we use \\ for multi-case lambdas with layout? Actually, \\ is a valid (infix) function name... and the base library includes one in Data.List. That name is copied in several other container interfaces, as well. ~d __

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-05 Thread wagnerdm
Quoting wagne...@seas.upenn.edu: Well, for what it's worth, my vote goes for a multi-argument \case. I Just saw a proposal for \of on the reddit post about this. That's even better, since: 1. it doesn't change the list of block heralds 2. it doesn't mention case, and therefore multi-arg \o

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-05 Thread wagnerdm
Quoting Mikhail Vorozhtsov : After 21 months of occasional arguing the lambda-case proposal(s) is in danger of being buried under its own trac ticket comments. We need fresh blood to finally reach an agreement on the syntax. Read the wiki page[1], take a look at the ticket[2], vote and comm

Re: Kindness of strangers (or strangeness of Kinds)

2012-06-07 Thread wagnerdm
Quoting AntC : GHC 7.2.1> :k (->) :: ?? -> ? -> * GHC 7.4.1> :k (->) :: * -> * -> * At first sight (->) is becoming less polyKinded. Is the eventual aim to be: GHC 7.6+> :k (->) :: AnyKind1 -> AnyKind2 -> * I sort of doubt it. After all, the prototypical thing to do with a function is to

Re: Kindness of strangers (or strangeness of Kinds)

2012-06-06 Thread wagnerdm
Quoting AntC : {-# OPTIONS_GHC -XDataKinds -XPolyKinds -XKindSignatures#-} data MyNat = Z | S Nat class NatToIntN (n :: MyNat) where natToIntN :: (n :: MyNat) -> Int instance NatToIntN Z where natToIntN _ = 0 instance (NatToIntN n) => NatToIntN (S n)

Re: Help me grok addFinalizer

2012-02-16 Thread wagnerdm
Quoting Antoine Latter : On Thu, Feb 16, 2012 at 2:04 PM, Michael Craig wrote: When I read the docs for System.Mem.Weak, it all seems to make sense. But then this code doesn't run as I expect it to when I turn on -threaded: http://hpaste.org/63832 (Expected/actual output are listed in the past

Re: Is it true that an exception is always terminates the thread?

2012-01-23 Thread wagnerdm
Quoting Heka Treep : actor mbox = do empty <- atomically $ isEmptyTChan mbox if empty then actor mbox else do val <- atomically $ readTChan mbox putStrLn val actor mbox This looks a bit silly. Why not just this? actor mbox = forever $ atomically (readTChan mbox)

RE: Unit unboxed tuples

2011-12-28 Thread wagnerdm
Quoting Simon Peyton-Jones : for example. Singleton unboxed tuples are a perfectly valid data type; it's just that we don't (now) have a name for their constructor. Well, Haskell *does* have a mechanism for giving two different implementations to a particular name... class UnboxedUnit a

Re: ConstraintKinds and default associated empty constraints

2011-12-21 Thread wagnerdm
Quoting Bas van Dijk : I'm playing a bit with the new ConstraintKinds feature in GHC 7.4.1-rc1. I'm trying to give the Functor class an associated constraint so that we can make Set an instance of Functor. The following code works but I wonder if the trick with: class Empty a; instance Empty a,

Re: Why not allow empty record updates?

2011-11-15 Thread wagnerdm
Quoting Yitzchak Gale : Yes. The translation of record updates given in the Report makes perfect sense for {}. It is only forbidden by "n >= 1", but no reason is given for that restriction. It doesn't make sense to me. The translation explodes a value into a case statement over its construct

Re: Should GHC default to -O1 ?

2011-11-08 Thread wagnerdm
Quoting Conrad Parker : I don't think compile time is an issue for new users when building HelloWorld.hs and getting the hang of basic algorithms and data structures. Anyone could explicitly set -O0 if they are worried about compile times for a larger project. I don't agree that GHC's user int

Re: problems with impredicativity

2011-11-04 Thread wagnerdm
Quoting wagne...@seas.upenn.edu: Quoting Wolfgang Jeltsch : this code is accepted by GHC 7.0.4: However, this one isn?t: {-# LANGUAGE ImpredicativeTypes #-} polyId :: (forall a. Maybe a) -> Maybe a polyId x = x polyIdMap :: [forall a. Maybe a] -> [forall a. Maybe a] polyIdMap xs = fmap po

Re: problems with impredicativity

2011-11-04 Thread wagnerdm
Quoting Wolfgang Jeltsch : this code is accepted by GHC 7.0.4: However, this one isn?t: {-# LANGUAGE ImpredicativeTypes #-} polyId :: (forall a. Maybe a) -> Maybe a polyId x = x polyIdMap :: [forall a. Maybe a] -> [forall a. Maybe a] polyIdMap xs = fmap polyId xs Is there a way to make it

Re: Is this a concurrency bug in base?

2011-10-09 Thread wagnerdm
Quoting Jean-Marie Gaillourdet : That sounds plausible. Do you see any workaround? Perhaps repeatedly evaluating typeOf? If there's a concurrency bug, surely the workaround is to protect calls to the non-thread-safe function with a lock. typeOfWorkaround lock v = do () <- take

RE: Evaluating type expressions in GHCi

2011-09-20 Thread wagnerdm
Would it be possible to have no command at all? Types are distinguished by upper-case letters, so it should be possible to tell whether a given expression is a value-level or a type-level expression. I guess that's not strictly true, since the expression could be _only_ type variables -- bu

Re: INLINE pragma changes in 7.2.1

2011-08-13 Thread wagnerdm
The behavior of the compilation part didn't change, GHC just started complaining about nonsense. See http://hackage.haskell.org/trac/ghc/ticket/5084 for more information. ~d Quoting Antoine Latter : Hi GHC, Did the behavior of the INLINE prgama change in version 7.2.1? I didn't see anythi

System.Process.system in Windows

2011-08-03 Thread wagnerdm
Hello all, I had a bit of fun recently tracking down quoting issues with the "system" command in Windows. For the examples below, I'll consistently use "Windows> " as the beginning of some text sent to the Windows command prompt cmd.exe, and use "GHC> " as the beginning of some text sent