Re: [Haskell-cafe] sequence causing stack overflow on pretty small lists

2013-08-27 Thread Patrick Palka
On Mon, Aug 26, 2013 at 4:46 AM, Niklas Hambüchen wrote: > On #haskell we recently had a discussion about the following: > >import System.Random > >list <- replicateM 100 randomIO :: IO [Int] > > I would think that this gives us a list of a million random Ints. In > fact, this is what

Re: [Haskell-cafe] OpenGL: No instance for Random GLfloat

2012-05-02 Thread Patrick Palka
Because GLfloat is simply a newtype wrapper for CFloat, which has a Random instance, I would do: {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} deriving instance Random GLFloat On Wed, May 2, 2012 at 6:29 PM, Mark Spezzano wrote: > Hi Haskellers, > > I'm trying t

Re: [Haskell-cafe] Control defaulting in ghci

2012-07-08 Thread Patrick Palka
On 7/8/2012 11:28 AM, Roman Cheplyaka wrote: Is there a way to control defaulting in ghci? (Like the "default" declaration in source files does.) ghci 7.4.1 doesn't accept "default" declarations. I tried loading a module with a "default" declaration, but that also didn't affect the ghci session.

Re: [Haskell-cafe] Data structure containing elements which are instances of the same type class

2012-08-11 Thread Patrick Palka
On Sat, Aug 11, 2012 at 4:14 AM, wrote: > > I'd like to point out that the only operation we can do on the first > argument of MkFoo is to show to it. This is all we can ever do: > we have no idea of its type but we know we can show it and get a > String. > That's not all you can do: you can als

Re: [Haskell-cafe] GHC maintenance on Arch

2012-10-28 Thread Patrick Palka
On Sun, Oct 28, 2012 at 5:54 PM, wrote: > There seems to be a bit of a clash between ghc being a tool, and ghc > being a toy. There need not be. Your works-for-me is great but it is > meaningless to those of us who use ghc as a tool for larger projects. > This is not specific to GHC. Arch Lin

Re: [Haskell-cafe] ~ operator ?

2013-02-18 Thread Patrick Palka
The difference the ~ makes in this case is that `uncurry4 (\_ _ _ _ -> ()) undefined` evaluates to `()` instead of bottom. The ~ is called an irrefutable pattern, and it helps make code that pattern matches on constructors more lazy. This seems like a good explanation of the subject: http://en.wiki

[Haskell-cafe] Two GHC-related GSoC Proposals

2013-04-21 Thread Patrick Palka
Hi, I'm interested in participating in the GSoC by improving GHC with one of these two features: 1) Implement native support for compiling modules in parallel (see #910). This will involve making the compilation pipeline thread-safe, implementing th

Re: [Haskell-cafe] Two GHC-related GSoC Proposals

2013-04-21 Thread Patrick Palka
d proposal would ideally include some > estimation on how it can impact some benchmarks/projects. It looks much > less like a "trap" and if you propose enough improvements that it can fill > a whole GSoC, considering how big the impact can be, yes, this would of > course b

Re: [Haskell-cafe] Two GHC-related GSoC Proposals

2013-04-21 Thread Patrick Palka
are high value projects, helping improve the > parallel build tooling (whether in performance or correctness or both!) has > a more obvious scope of community impact, and if you can layout a clear > plan of work that GHC folks agree with and seems doable, i'd favor that > project :)

Re: [Haskell-cafe] Two GHC-related GSoC Proposals

2013-06-01 Thread Patrick Palka
ng > > a task DAG. Fortunately the granularity is coarse. > > > > -Ryan > > > > > > > > On Sun, Apr 21, 2013 at 10:34 PM, Patrick Palka > > wrote: > >> > >> Good points. I did not take into account whether proposal #2 may be >

Re: [Haskell-cafe] Two GHC-related GSoC Proposals

2013-06-02 Thread Patrick Palka
Right, these optimizations are done on the unboxed level, where bottom is not a concern. GHC would transform bar a b = a + b - a - b to bar (I# a) (I# b) = I# (a +# b -# a -# b) whose RHS could be optimized away to I# 0#. bar is still strict in its two arguments, so calling bar undefined undefi

Re: [Haskell-cafe] Fixed points

2011-06-10 Thread Patrick Palka
FWIW, what you have written is equivalent to equivalenceClosure = fix (const (reflexivity . symmetry . transitivity)) and because the fixed point of `const a` is `a`, equivalenceClosure = reflexivity . symmetry . transitivity which obviously only performs a single pass on its input On Fri, Ju