[Haskell-cafe] Re: Haskell Quick Reference (1-page PDF)

2008-11-06 Thread Benjamin L . Russell
The reference includes both pairs and triples under "Tuples," but only pairs under "Bigger types." You may wish to add the following example under "Bigger types": (a, b, c) triple of types a, b, and c (a, b, and c are type variables) Also, the examples under "Tuples" suggest that only pairs

Re: [Haskell-cafe] Bit Field Marshalling

2008-11-06 Thread Bulat Ziganshin
Hello Michael, Friday, November 7, 2008, 8:51:46 AM, you wrote: > Have others run into this problem before? What options are there for > working around it? if your goal is to maximize portability and not speed, one option is to make another structure without bit fields, and add C helper functio

Re: [Haskell-cafe] Problems with strictness analysis?

2008-11-06 Thread Patai Gergely
> I tried your example in GHC 6.10 and isum appears to work fine. > The type of 1000 gets defaulted to Integer, a specialized version > of isum for Integer is then created, the strictness analyzer > determines that isum is strict in s, and the code generator produces a > loop. (If you want to

[Haskell-cafe] Bit Field Marshalling

2008-11-06 Thread Michael D. Adams
I'm writing a Storable instance for a data type that marshals to a C structure that contains bit fields such as the following: struct Foo { short x; short y; unsigned int a : 1; unsigned int b : 1; unsigned int c : 1; unsigned int d : 1; unsigned int reserved : 12; } For the "x" and

Re: [Gtk2hs-users] [Haskell-cafe] Anyone know why this always returns invalid texture objects?

2008-11-06 Thread Jefferson Heard
Ah, that's good to know. I thought initGL would create the context. Sorry to be unclear in the code I posted, but part of createGUIObject is a glDrawingAreaNew. It creates a drawing area, which is then stored in a giant UserInterface record. data UserInterface = MainWindow { ... , drawing_ca

Re: [Haskell-cafe] Anyone know why this always returns invalid texture objects?

2008-11-06 Thread Bertram Felgenhauer
[CCing gtk2hs-users] Jefferson Heard wrote: > import Graphics.UI.Gtk > import Graphics.UI.Gtk.Glade > import Graphics.UI.Gtk.OpenGL > import qualified Graphics.Rendering.OpenGL as GL > import Graphics.Rendering.OpenGL (($=)) > > main = do > initGUI > initGL "initGL" may be slightly misleadin

Re: [Haskell-cafe] Problem compiling hdbc with GHC 6.10.1 in windows

2008-11-06 Thread PJ Durai
On Thu, Nov 6, 2008 at 4:44 PM, Thomas Schilling <[EMAIL PROTECTED]> wrote: > You need to use base-3. For a temporary fix, edit the file HDBC.cabal > and change the base part of the "build-depends" to look like this: > base == 3.*, (wherever it occurs) > That worked. Thanks! > 2008/11/6 PJ Durai

Re: [Haskell-cafe] Problem compiling hdbc with GHC 6.10.1 in windows

2008-11-06 Thread Don Stewart
Or build with --constraint='base<4' nominolo: > You need to use base-3. For a temporary fix, edit the file HDBC.cabal > and change the base part of the "build-depends" to look like this: > base == 3.*, (wherever it occurs) > > 2008/11/6 PJ Durai <[EMAIL PROTECTED]>: > > Greetings > > > > I would

Re: [Haskell-cafe] Problem compiling hdbc with GHC 6.10.1 in windows

2008-11-06 Thread Thomas Schilling
You need to use base-3. For a temporary fix, edit the file HDBC.cabal and change the base part of the "build-depends" to look like this: base == 3.*, (wherever it occurs) 2008/11/6 PJ Durai <[EMAIL PROTECTED]>: > Greetings > > I would like to report that I am not able to compile hdbc 1.1.5.0. > >

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Haddock version 2.4.0

2008-11-06 Thread Thomas Schilling
[Redirecting to cafe@ since haskell@ is not meant for discussions] Sure, they are bad for one reason: you cannot link to a frame configuration directly. However, for this particular use case they are quite handy. There are some features missing (like hoogle integration) and some annoyances (if j

Re: [Haskell-cafe] Writing an IRC bot, problems with plugins

2008-11-06 Thread Bertram Felgenhauer
Alexander Foremny wrote: > I am writing an single server, multi channel IRC bot with the support of > plugins and limited plugin communication. With the plugin system I am facing > problems I cannot really solve myself. Here's an approach built completely around Data.Typeable. The fundamental idea

[Haskell-cafe] Anyone know why this always returns invalid texture objects?

2008-11-06 Thread Jefferson Heard
import Graphics.UI.Gtk import Graphics.UI.Gtk.Glade import Graphics.UI.Gtk.OpenGL import qualified Graphics.Rendering.OpenGL as GL import Graphics.Rendering.OpenGL (($=)) main = do initGUI initGL GL.shadeModel $= GL.Flat GL.depthFunc $= Just GL.Less (window1,gui,dlgs) <- constructGUIObje

Re: [Haskell-cafe] pure programs

2008-11-06 Thread Jason Dusek
Conal Elliott <[EMAIL PROTECTED]> wrote: > To help me understand your question, would you be unhappy with > the following structure? > > -- runnable > main = interact f > -- composable > f = ... > > The discipline is to use interact (or another combinator) to > wrap a functional/com

[Haskell-cafe] Problem compiling hdbc with GHC 6.10.1 in windows

2008-11-06 Thread PJ Durai
Greetings I would like to report that I am not able to compile hdbc 1.1.5.0. $ runghc.exe Setup.lhs build Preprocessing library HDBC-1.1.5... Building HDBC-1.1.5... [1 of 6] Compiling Database.HDBC.ColTypes ( Database\HDBC\ColTypes.hs, dist\build\Database\HDBC\ColTypes.o ) [2 of 6] Compiling Data

Re: [Haskell-cafe] ghc-6.11 + OpenGL/GLUT crashes on WinXP

2008-11-06 Thread David Sankel
With ghc 6.10.1, the patches aren't necessary for the lasted releases of the bindings. I've put a walkthrough on my blog for the process of getting `freeglut+GLUT binding+GL binding+ghc 6.10.1` up and running. http://netsuperbrain.com/blog/ David On Tue, Oct 28, 2008 at 10:48 AM, David Sankel <[

Re: [Haskell-cafe] Re: Monad.Reader with updates

2008-11-06 Thread Ryan Ingram
Hi Mauricio. What you want actually already exists in QuickCheck as the "Gen" monad. >From >http://hackage.haskell.org/packages/archive/QuickCheck/1.1.0.0/doc/html/src/Test-QuickCheck.html#Gen newtype Gen a = Gen (Int -> StdGen -> a) instance Monad Gen where return a= Gen (\n r -> a)

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Haddock version 2.4.0

2008-11-06 Thread David Waern
2008/11/6 Wolfgang Jeltsch <[EMAIL PROTECTED]>: > Am Donnerstag, 6. November 2008 00:21 schrieb David Waern: >> * Add framed view of the HTML documentation > > After many years with many people telling us that frames are bad, you add > frame support to Haddock? Hmm. You should discuss this with

Re: [Haskell-cafe] Re: Monad.Reader with updates

2008-11-06 Thread Jules Bean
Mauricio wrote: The problem is that I need 'a' or 'b' above to sometimes also change the environment. I think with this method I could not get that. I no longer understand what you want. I thought you wanted an environment which automatically changed every "step". I showed you how you can

Re: [Haskell-cafe] Re: http://www.haskell.org/ghc/docs/latest/html/libraries/Cabal/Distribution-Simple.html

2008-11-06 Thread Ross Mellgren
The docs in latest are for 6.10.1 at this point, I don't think that function is in 6.8.2: http://www.haskell.org/ghc/docs/6.8.2/html/libraries/Cabal/Distribution-Simple.html -Ross Maurí­cio wrote: According to this page: http://www.haskell.org/ghc/docs/latest/html/libraries/Cabal/Distribution

[Haskell-cafe] Re: Monad.Reader with updates

2008-11-06 Thread Maurí­cio
[...] Are you sure you don't want to use monad transformers? No. Do you have a sugestion on how could I do it in this situation? Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: http://www.haskell.org/ghc/docs/latest/html/libraries/Cabal/Distribution-Simple.html

2008-11-06 Thread Maurí­cio
According to this page: http://www.haskell.org/ghc/docs/latest/html/libraries/Cabal/Distribution-Simple.html there's an available toplevel declaration named: autoconfUserHooks in Distribution.Simple. However: ghci --version The Glorious Glasgow Haskell Compilation System, version 6.8.2 ghci

Re: [Haskell-cafe] Haskell Quick Reference (1-page PDF)

2008-11-06 Thread Joachim Breitner
Hi, the reference suggests the use of otherwise (instead of _) as the default pattern in a case expression. While it certainly works, isn’t it bad style, as it shadows Prelude.otherwise: $ cat otherwise.lhs ; runhaskell otherwise.lhs >demo b arg = case b of > True -> do print

[Haskell-cafe] Re: Monad.Reader with updates

2008-11-06 Thread Achim Schneider
Mauricio <[EMAIL PROTECTED]> wrote: > [...] > Are you sure you don't want to use monad transformers? -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibite

[Haskell-cafe] Re: Monad.Reader with updates

2008-11-06 Thread Mauricio
Is there some abstraction in current ghc library that implements something like Reader, but where the value of the environment is updated at every "step"? >>> > It doesn't quite make sense, because one "step" isn't well defined. > How many "steps" is "return (f x)" ? how

Re: [Haskell-cafe] http://www.haskell.org/ghc/docs/latest/html/libraries/Cabal/Distribution-Simple.html

2008-11-06 Thread Gwern Branwen
On Thu, Nov 6, 2008 at 7:59 AM, Mauricio <[EMAIL PROTECTED]> wrote: > Hi, > > According to this page: > > http://www.haskell.org/ghc/docs/latest/html/libraries/Cabal/Distribution-Simple.html > > there's an available toplevel declaration named: > > autoconfUserHooks > > in Distribution.Simple. Howev

[Haskell-cafe] http://www.haskell.org/ghc/docs/latest/html/libraries/Cabal/Distribution-Simple.html

2008-11-06 Thread Mauricio
Hi, According to this page: http://www.haskell.org/ghc/docs/latest/html/libraries/Cabal/Distribution-Simple.html there's an available toplevel declaration named: autoconfUserHooks in Distribution.Simple. However: ghci --version The Glorious Glasgow Haskell Compilation System, version 6.8.2

Re: [Haskell-cafe] Re: Monad.Reader with updates

2008-11-06 Thread Jules Bean
Mauricio wrote: Is there some abstraction in current ghc library that implements something like Reader, but where the value of the environment is updated at every "step"? do-it-yourself? you can start from reader definition and add what you need. you just need to make "initial state" consisting

Re: [Haskell-cafe] Re: Monad.Reader with updates

2008-11-06 Thread Bulat Ziganshin
Hello Mauricio, Thursday, November 6, 2008, 2:52:16 PM, you wrote: > that. But I wanted to know if there's already the > "right way to do it" instead of my "newbie way to > do it" :) "All about monads" doesn't mention it, at least :) -- Best regards, Bulatmailto:[

[Haskell-cafe] Re: Monad.Reader with updates

2008-11-06 Thread Mauricio
Is there some abstraction in current ghc library that implements something like Reader, but where the value of the environment is updated at every "step"? do-it-yourself? you can start from reader definition and add what you need. you just need to make "initial state" consisting from state itsel

Re: [Haskell-cafe] Monad.Reader with updates

2008-11-06 Thread Bulat Ziganshin
Hello Mauricio, Thursday, November 6, 2008, 2:30:00 PM, you wrote: > Is there some abstraction in current ghc library > that implements something like Reader, but where > the value of the environment is updated at every > "step"? do-it-yourself? you can start from reader definition and add what

[Haskell-cafe] Monad.Reader with updates

2008-11-06 Thread Mauricio
Hi, Is there some abstraction in current ghc library that implements something like Reader, but where the value of the environment is updated at every "step"? I imagine something that instead of running like this: runReader ( do ... ) environment I would run like: runReader ( do ... ) environm

[Haskell-cafe] Re: Problems with strictness analysis?

2008-11-06 Thread Achim Schneider
wren ng thornton <[EMAIL PROTECTED]> wrote: > If Haskell had strictness annotations as part of the type system, > then there might be room for progress. We could imagine constructing > separate polymorphic bodies for isum, one for each strictness variant > of (+). Then, when isum is instantiated a

Re: [Haskell-cafe] Problems with strictness analysis?

2008-11-06 Thread Lennart Augustsson
I tried your example in GHC 6.10 and isum appears to work fine. The type of 1000 gets defaulted to Integer, a specialized version of isum for Integer is then created, the strictness analyzer determines that isum is strict in s, and the code generator produces a loop. (If you want to look at th

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Haddock version 2.4.0

2008-11-06 Thread David Waern
2008/11/6 Duncan Coutts <[EMAIL PROTECTED]>: > Will .haddock files generated by haddock-2.3.0 work with haddock-2.4? If > not it would be preferable to have a 2.3.1 release or something for > distributions that want to package haddock separately from ghc (eg > gentoo). Otherwise we somehow have to

Re: [Haskell-cafe] Undefined symbols base_DataziTuple_ZxxxT_con_info

2008-11-06 Thread dmitry shkurko
Hello Bulat, Thanks for suggestion. The problem is not reproducible w/ GHC 6.10.1. Regards, Dmitry On Thu, Nov 6, 2008 at 2:01 AM, Bulat Ziganshin <[EMAIL PROTECTED]> wrote: > Hello dmitry, > > Wednesday, November 5, 2008, 10:46:20 PM, you wrote: > >> (.text+0x66dd7):fake: undefined reference to

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Haddock version 2.4.0

2008-11-06 Thread Duncan Coutts
On Thu, 2008-11-06 at 00:21 +0100, David Waern wrote: > > -- Haddock 2.4.0 > > > A new version of Haddock, the Haskell documentation tool, is out. > > This is a later version than the one shipped with GHC 6.

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-06 Thread wren ng thornton
Bulat Ziganshin wrote: Hello wren, Thursday, November 6, 2008, 12:00:22 PM, you wrote: the trie automaton I mentioned in my previous post: just add a (?{ $value = ... }) action to the end of each component regex and read out the value of $value after you match. $value? in haskell? :) Shh,

Re[2]: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-06 Thread Bulat Ziganshin
Hello wren, Thursday, November 6, 2008, 12:00:22 PM, you wrote: > the trie automaton I mentioned in my previous post: just add a (?{ > $value = ... }) action to the end of each component regex and read out > the value of $value after you match. $value? in haskell? :) -- Best regards, Bulat

Re: [Haskell-cafe] Re: Efficient parallel regular expressions

2008-11-06 Thread wren ng thornton
ChrisK wrote: If you need to be left-biased then you need a perl-style engine, and you can use the regex-pcre or pcre-light haskell package and the PCRE library. These are obtainable from Hackage. I doubt PCRE uses a simple DFA... I don't know if regex-pcre or pcre-light supports the (?{...

Re: [Haskell-cafe] Efficient parallel regular expressions

2008-11-06 Thread wren ng thornton
Mitchell, Neil wrote: Hi Martijn, > It's not that tricky if you do a regular expression state machine > yourself, but that's probably a bit too much work. One way to get > a speed up might be to take the regular expressions a,b,c,d and > generate a regex a+b+c+d, and one a+b. You can then check

Re: [Haskell-cafe] Re: Problems with strictness analysis?

2008-11-06 Thread wren ng thornton
Dominic Steinitz wrote: wren ng thornton freegeek.org> writes: [snick] > > isum 0 s = s > > isum n s = isum (n-1) (s+n) > This is tail recursive, and will be optimized to an iterative loop; [snick] > In terms of having a compiler 'smart enough', it's not clear that > functions of this sor

[Haskell-cafe] Re: foldl vs foldl'

2008-11-06 Thread Achim Schneider
Derek Elkins <[EMAIL PROTECTED]> wrote: > On Wed, 2008-11-05 at 10:01 -0800, Daryoush Mehrtash wrote: > > Lets assume we don't have undefined in the list, are there functions > > (or properties in the function) that would cause foldl to have > > different results than foldl'? > > The only differe