Re: [Haskell-cafe] indentation with let and do

2013-10-03 Thread Brandon Allbery
On Thu, Oct 3, 2013 at 2:31 PM, Corentin Dupont wrote: > test :: Bool -> IO () > test foo = do >let bar = case foo of >True -> "Foo"; >False -> "Bar" >return () > > while this one does (just adding one space in front of True and False): > > test :: Bool -> IO () > test foo

Re: [Haskell-cafe] Strange exit status behavior from the process package

2013-09-21 Thread Brandon Allbery
On Sat, Sep 21, 2013 at 11:12 PM, Michael Xavier wrote: > I've run into some strangeness with the process package. When you kill > some processes on the command line you correctly get a non-zero exit > status. However when using the process package's terminateProcess (which > sends a SIGTERM), it

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Brandon Allbery
On Sat, Sep 21, 2013 at 12:43 PM, David Thomas wrote: > Sure. An interesting, if not terribly relevant, fact is that there are > more irrational numbers that we *can't* represent the above way than that > we can (IIRC). > I think that kinda follows from diagonalization... it does handle more cas

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-21 Thread Brandon Allbery
On Sat, Sep 21, 2013 at 12:35 PM, Bardur Arantsson wrote: > On 2013-09-20 18:31, Brandon Allbery wrote: > [--snip--] > > unless you have a very clever representation that can store > > in terms of some operation like sin(x) or ln(x).) > > I may just be hallucinating, bu

Re: [Haskell-cafe] Mystery of an Eq instance

2013-09-20 Thread Brandon Allbery
On Fri, Sep 20, 2013 at 12:17 PM, damodar kulkarni wrote: > Ok, let's say it is the effect of truncation. But then how do you explain > this? > > Prelude> sqrt 10.0 == 3.1622776601683795 > True > Prelude> sqrt 10.0 == 3.1622776601683796 > True > Because there's no reliable difference there. The t

Re: [Haskell-cafe] Trouble installing haskeline: ExitFailure 139

2013-09-14 Thread Brandon Allbery
On Sat, Sep 14, 2013 at 4:57 PM, David Banas wrote: > Has anyone else hit an unexplained *ExitFailure 139* when trying to > install the *haskeline* package? > 139 sounds like how the shell passes on "Segmentation fault (core dumped)". -- brandon s allbery kf8nh si

Re: [Haskell-cafe] Proposal: New syntax for Haskell

2013-09-12 Thread Brandon Allbery
On Thu, Sep 12, 2013 at 6:00 PM, David Thomas wrote: > I've long been interested in a scripting language designed to be spoken. > Not interested enough to go about making it happen... but the idea is > fascinating and possibly useful. > http://en.wikipedia.org/wiki/Shakespeare_(programming_langua

Re: [Haskell-cafe] Unary functions and infix notation

2013-09-06 Thread Brandon Allbery
On Fri, Sep 6, 2013 at 11:04 AM, Johannes Emerich wrote: > Desugaring of an equivalent source file shows that id is applied to the > anonymous function, which is then applied to 1. > > The following example of a function that is not polymorphic in its return > type behaves closer to what I would h

Re: [Haskell-cafe] How to read a file and return a String?

2013-09-04 Thread Brandon Allbery
On Wed, Sep 4, 2013 at 10:21 AM, yi lu wrote: > I want to read a text file, and store it in a *String*. But readFile will > get *IO String*. I search with google and they tell me it is not > necessarily to do so. Can you explain to me why is this? Furthermore, How > to read a file and store it in

Re: [Haskell-cafe] Unexpected behaviour with send and send-buffer setting

2013-09-03 Thread Brandon Allbery
On Tue, Sep 3, 2013 at 7:58 PM, Joey Adams wrote: > On Tue, Sep 3, 2013 at 6:56 PM, Simon Yarde wrote: > >> I'm new to Haskell and have reached an impasse in understanding the >> behaviour of sockets. >> >> The crux of my line of enquiry is this; how can my application know when >> to pause in g

Re: [Haskell-cafe] World's First Commercial Haskell IDE and Deployment Platform, FP Haskell Center Launches Today

2013-09-03 Thread Brandon Allbery
On Tue, Sep 3, 2013 at 3:35 PM, Mathijs Kwik wrote: > You can always try the attached docx! :) Which likewise showed nothing. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com ballb...@sinenomine.net unix, opena

Re: [Haskell-cafe] Unexpected behaviour with send and send-buffer setting

2013-09-03 Thread Brandon Allbery
On Tue, Sep 3, 2013 at 6:56 PM, Simon Yarde wrote: > I've found that setting the send buffer size causes send to truncate the > ByteString to the buffer size, but that successive sends continue to > succeed when the buffer should be full. > I see no actual flow control here. That the receiver is

Re: [Haskell-cafe] Template Haskell: let statement in a splice put in the "main = do" part of a program?

2013-08-24 Thread Brandon Allbery
On Sat, Aug 24, 2013 at 11:00 AM, TP wrote: > main = do > > $(makeLetStatement "a") > -- print a > Is that the actual indentation you used? Because it's wrong if so, and the error you would get is the one you're reporting. Indentation matters in Haskell. In an equation for `main': main = do

Re: [Haskell-cafe] Errors in non-monadic code

2013-08-19 Thread Brandon Allbery
On Mon, Aug 19, 2013 at 2:59 PM, wrote: > I'd say that if you were in the context of the IO monad, maybe you'd > prefer to use exceptions instead of 'Either' or 'Maybe'. > Even in IO, exceptions should be reserved for truly exceptional conditions (of the "program cannot safely continue" variety)

Re: [Haskell-cafe] Errors in non-monadic code

2013-08-19 Thread Brandon Allbery
On Mon, Aug 19, 2013 at 2:09 PM, Brandon Allbery wrote: > Alternatively, have you considered using your own ADT? `data Validity = > Success | Failure String` would give you more readable / comprehensible > code without needing to worry about assumptions or common usage. Or possibly

Re: [Haskell-cafe] Errors in non-monadic code

2013-08-19 Thread Brandon Allbery
On Mon, Aug 19, 2013 at 1:48 PM, wrote: > What is the proper way to implement a non-monadic function that checks > whether a given value is correct and gives a proper error message > otherwise ? What is the recommended option ? > > * Either String a > Preferred, usually, since Nothing is regarde

Re: [Haskell-cafe] abs minBound < (0 :: Int) && negate minBound == (minBound :: Int)

2013-08-19 Thread Brandon Allbery
On Mon, Aug 19, 2013 at 11:43 AM, Kyle Miller wrote: > Or, three other options: 1) make MIN_INT outside the domain of abs, 2) > make the range of abs be some unsigned int type, or 3) use Integer (i.e., > use a type which actually represents integers rather than a type which can > only handle smal

Re: [Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-17 Thread Brandon Allbery
On Sat, Aug 17, 2013 at 5:59 PM, Hartmut Pfarr wrote: > query_ conn "select 2 + 2" > > I've no errors any more. > But: I don't see any result (for sure, it is not coeded yet) > Yes, because you're not capturing it; it's the return value from `query_`, which you are throwing away above instead o

Re: [Haskell-cafe] Database.postgreSQL.Simple - ambigious type

2013-08-17 Thread Brandon Allbery
On Sat, Aug 17, 2013 at 1:35 PM, Hartmut Pfarr wrote: > (The example is identical to the first 5-liner-example in the package > documentation) > As I read it, the example has a typo: it should be using `query_` instead of `query`. See http://hackage.haskell.org/packages/archive/postgresql-simple/

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Brandon Allbery
On Fri, Aug 16, 2013 at 10:49 AM, Tom Ellis < tom-lists-haskell-cafe-2...@jaguarpaw.co.uk> wrote: > On Fri, Aug 16, 2013 at 10:26:42AM -0400, Brandon Allbery wrote: > > My understanding is that there's a rework of Arrow in progress that may > > change this in the

Re: [Haskell-cafe] Applicative is like an Arrow

2013-08-16 Thread Brandon Allbery
On Fri, Aug 16, 2013 at 10:04 AM, Thiago Negri wrote: > I just stumbled upon the Applicative term. > Arrows are quite difficult for me to understand at the moment. > I guess it needs time to digest. > > But, as I understand so far, Applicative and Arrows looks like the same > thing. > Practicall

Re: [Haskell-cafe] more gtk help

2013-08-13 Thread Brandon Allbery
On Tue, Aug 13, 2013 at 10:45 PM, wrote: > fooBar = > do putStrLn "foo" >return True > > so then I thought, aha!, all I need to do is understand the type of > "return True" and all will be revealed to me. Well, it's this: > > Control.Monad.Trans.Reader.ReaderT >(GHC.Ptr.Ptr

Re: [Haskell-cafe] llvm on macos

2013-08-10 Thread Brandon Allbery
On Sat, Aug 10, 2013 at 12:53 PM, Dominic Steinitz wrote: > Thank you very much. I used Homebrew. Now I can compile albeit with a > warning. I have yet to try running it. > > Loading package repa-3.2.3.1 ... linking ... done. > You are using a new version of LLVM that hasn't been tested yet! > We

Re: [Haskell-cafe] Renumbered mailing list posts

2013-08-10 Thread Brandon Allbery
On Sat, Aug 10, 2013 at 11:38 AM, Niklas Hambüchen wrote: > (Also fact that hpaste just went away, invalidating all my links to > hpastes, is similarly bad.) Those at least are recoverable, just replace hpaste.org with lpaste.net(content is still there). But still. -- brandon s allbery kf8nh

Re: [Haskell-cafe] llvm on macos

2013-08-10 Thread Brandon Allbery
On Sat, Aug 10, 2013 at 7:39 AM, Dominic Steinitz wrote: > : > Warning: Couldn't figure out LLVM version! > Make sure you have installed LLVM > ghc: could not execute: opt > > The ghc documentation > ( > http://www.haskell.org/ghc/docs/7.6.1/html/users_guide/code-generators.html >

Re: [Haskell-cafe] Installing wxHaskel on Snow Leopard

2013-08-08 Thread Brandon Allbery
On Thu, Aug 8, 2013 at 12:04 PM, Eduardo Sato wrote: > Would it be necessary to change Info.plist? > I don't believe so; Info.plist is the externally visible interface details, but these libraries should be hidden inside the app bundle and not visible outside of it. When the runtime dynamic libra

Re: [Haskell-cafe] Installing wxHaskel on Snow Leopard

2013-08-08 Thread Brandon Allbery
On Thu, Aug 8, 2013 at 9:54 AM, Eduardo Sato wrote: > The only problem now is that I want to distribute a wxHaskell application > on mac OS X. I tried using macosx-app and cabal-macosx ( > https://github.com/michaelt/cabal-macosx) to make an "app" file. It runs > fine on my machine, but it fails

Re: [Haskell-cafe] Alternative name for return

2013-08-06 Thread Brandon Allbery
On Tue, Aug 6, 2013 at 9:10 PM, Richard A. O'Keefe wrote: > I bet you can find an abundance of C programmers who think that > "strcmp" is an intuitive name for string comparison (rather than > compression, say). > Them and a small and slowly shrinking group of folks who find it intuitive because

Re: [Haskell-cafe] Alternative name for return

2013-08-06 Thread Brandon Allbery
On Tue, Aug 6, 2013 at 4:03 AM, J. Stutterheim wrote: > I have to admit that I am a bit torn about using `pure`. On the one hand, > if you actually have a pure value, it feels pretty intuitive to me. But > what about > > pure (putStrLn "Hi") > > `putStrLn "Hi"` is not a pure value... Or is ther

Re: [Haskell-cafe] Why GHC is written in Happy and not a monadic parser library?

2013-08-02 Thread Brandon Allbery
On Fri, Aug 2, 2013 at 8:49 PM, blackbox.dev.ml wrote: > Is there any specific reason why GHC is written in a parser GENERATOR > (Happy) and not in MONADIC PARSER COMBINATOR (like parsec)? > > Is Happy faster / handles better errors / hase some great features or > anything else? > Most probably b

Re: [Haskell-cafe] Sneaky method for var-arg fns?

2013-07-26 Thread Brandon Allbery
On Fri, Jul 26, 2013 at 5:08 PM, Micah Cowan wrote: > I was wondering if there was a way to do it in "pure" Haskell (i.e., no > GHC pragmas required), and also the specific reason for why the above > example doesn't work without the pragma (I think it's just that in > general a -> b is not syntac

Re: [Haskell-cafe] ordNub

2013-07-15 Thread Brandon Allbery
On Mon, Jul 15, 2013 at 10:31 PM, Ivan Lazar Miljenovic < ivan.miljeno...@gmail.com> wrote: > If I understand correctly, this function is proposed to be added to > Data.List which lives in base... but the proposals here are about > using either Sets from containers or HashSet from > unordered-cont

Re: [Haskell-cafe] ordNub

2013-07-15 Thread Brandon Allbery
On Sun, Jul 14, 2013 at 7:54 AM, Clark Gaebel wrote: > Oops sorry I guess my point wasn't clear. > > Why ord based when hashable is faster? Then there's no reason this has to > be in base, it can just be a > Did the point about "stable" fly overhead? -- brandon s allbery kf8nh

Re: [Haskell-cafe] getting haddock to cooperate with cpp

2013-07-12 Thread Brandon Allbery
On Fri, Jul 12, 2013 at 2:25 PM, Evan Laforge wrote: > In the broader scheme, it seems perverse to be using CPP in the first > place. I use it to configure imports and exports, e.g. to swap out a > driver backend on different OSes, and to export more symbols when > testing. Would it make sense

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Brandon Allbery
On Thu, Jul 11, 2013 at 2:58 PM, Vlatko Basic wrote: > Hm, I thought it is a pattern match with constant, as in f ('a':xs) == >> > > I wonder what you'd make of this definition, then? > > (*) `on` f = \x y -> f x * f y > > > According to the enlightenment above, I'd say (*) is a variable tha

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Brandon Allbery
On Thu, Jul 11, 2013 at 2:11 PM, Vlatko Basic wrote: > The problem here isn't quite what you think it is; (==) is not a > constructor, therefore it is a *variable*. It's exactly the same problem as > > a = 5 > -- ... > foo a = 3 -- this does NOT compare with the previous value of "a";

Re: [Haskell-cafe] Comparing functions

2013-07-11 Thread Brandon Allbery
On Thu, Jul 11, 2013 at 1:33 PM, Vlatko Basic wrote: > data CmpFunction a = CF (a -> a -> Bool) > > that contains comparing functions, like ==, <, > ..., and I'm trying to > declare the Show instance for it like this > > instance Show (CmpFunction a) where > show (CF (==)) = "== "

Re: [Haskell-cafe] ghci & ghc -> JS (Emscripten)

2013-07-03 Thread Brandon Allbery
On Wed, Jul 3, 2013 at 6:26 AM, B B wrote: > Could you please answer one additional question - why you, while creating > GHCJS didn't base on emscripten? Why haven't you patched it and created > custom solution? > I'd like to point out that the LLVM code from GHC is CPS-transformed, and this mak

Re: [Haskell-cafe] Spam on list??

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 11:19 AM, Vlatko Basic wrote: > Anybody else getting this spam emails from j...@eukor.com every time a > message is sent to Cafe? > Yes, and I'm hoping a list admin steps in soon. The irony is, it's their *anti*spam filter. They decided to use one of those obnoxious white

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 9:56 AM, Tikhon Jelvis wrote: > I've thought about writing an automatic indenting tool for Haskell (or, > more accurately, a pretty-printer) for another project I have, and this is > the main thing that threw me off. While automatic indentation might make > sense for less e

Re: [Haskell-cafe] question about indentation conventions

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 3:43 AM, Tom Ellis < tom-lists-haskell-cafe-2...@jaguarpaw.co.uk> wrote: > > is OK but > > f (g x > > y z) > > is not. > > It seems to me that this means > > f x1 x2 > x3 x4 > > is not. The OP was initially asking about this situation. > If you wrote th

Re: [Haskell-cafe] Installing Z3 on OS X 10.8.4 ( Off topic )

2013-07-01 Thread Brandon Allbery
On Mon, Jul 1, 2013 at 8:34 AM, Johannes Waldmann < waldm...@imn.htwk-leipzig.de> wrote: > and note that the install script says: > > Z3 shared libraries were installed at /usr/local/lib, make sure this > directory is in your LD_LIBRARY_PATH environment variable. > Only applicable on Linux (and s

Re: [Haskell-cafe] tangential request...

2013-06-22 Thread Brandon Allbery
On Sat, Jun 22, 2013 at 9:49 PM, Michael Orlitzky wrote: > On 06/22/2013 01:28 PM, Mark Lentczner wrote: > > 3) Do not resize the terminal window > > and > > > 5) Take a screen shot of the whole terminal window > > are mutually exclusive? > No, he wants a window shot, not a whole-screen shot. Wh

Re: [Haskell-cafe] Strange cabal failure

2013-06-18 Thread Brandon Allbery
On Tue, Jun 18, 2013 at 1:57 PM, Jacques Carette wrote: > In trying to install the lens package, it eventually tries to install > transformers-compat-0.1.1.1 which in turn depends on transformers-0.3.0.0 > -- however that asksk for > transformers-0.3.0.0-**3006d6ea13a2c10770bffd4de7a96d**c9 > whic

Re: [Haskell-cafe] opengl type confusion

2013-06-16 Thread Brandon Allbery
On Sun, Jun 16, 2013 at 4:42 PM, wrote: > On Sun, 16 Jun 2013 16:15:25 -0400 > Brandon Allbery wrote: > > On Sun, Jun 16, 2013 at 4:03 PM, wrote: > > > Changing the declaration to GLdouble -> GLdouble -> GLdouble -> IO() > and > > > using > >

Re: [Haskell-cafe] opengl type confusion

2013-06-16 Thread Brandon Allbery
On Sun, Jun 16, 2013 at 4:03 PM, wrote: > Changing the declaration to GLdouble -> GLdouble -> GLdouble -> IO() and > using > (0.0::GLdouble) fixes it, and I'm not clear on why it's not automagic. > There are many times I see the Haskell never "automagic"s types in that context; if it expects G

Re: [Haskell-cafe] Automating Hackage accounts

2013-06-13 Thread Brandon Allbery
On Thu, Jun 13, 2013 at 10:48 AM, Niklas Hambüchen 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? Doesn't look like it. :( -- brandon s allbery kf8nh

Re: [Haskell-cafe] How to write a pure String to String function in Haskell FFI to C++

2013-06-02 Thread Brandon Allbery
On Sun, Jun 2, 2013 at 8:01 PM, Thomas Davie wrote: > On 2 Jun 2013, at 16:48, Brandon Allbery wrote: > > (String is a linked list of Char, which is also not a C char; it is a > constructor and a machine word large enough to hold a Unicode codepoint. > And because Haskell is

Re: [Haskell-cafe] How to write a pure String to String function in Haskell FFI to C++

2013-06-02 Thread Brandon Allbery
On Sun, Jun 2, 2013 at 7:22 PM, Ting Lei wrote: > In particular, I wanted to avoid having an IO in the return type because > introducing the impurity > (by that I mean the IO monad) for this simple task is logically > unnecessary. All examples involing > Anything that comes into or goes out of a

Re: [Haskell-cafe] Different answers on different machines

2013-06-01 Thread Brandon Allbery
On Sat, Jun 1, 2013 at 1:55 PM, wrote: > a Dell laptop and a desktop. I compiled this message with ghc -O2 > --make ex429.lhs and ran it on each machine. On the Dell I get: > > 136342232 > ./ex429 8.66s user 0.02s system 99% cpu 8.695 total > > When I run this exact same file on the desktop, I

Re: [Haskell-cafe] using a win32 dll (Happy too soon)

2013-05-30 Thread Brandon Allbery
On Thu, May 30, 2013 at 11:46 AM, Kees Bleijenberg < k.bleijenb...@lijbrandt.nl> wrote: > Brandon, thanks again for your explanation > Are you sure about the non existing search order for dynamic loaded dll’s? > I.e. > http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx#

Re: [Haskell-cafe] using a win32 dll (Happy too soon)

2013-05-30 Thread Brandon Allbery
On Thu, May 30, 2013 at 3:15 AM, Kees Bleijenberg < k.bleijenb...@lijbrandt.nl> wrote: > argument. The dll is in the PATH. I don't understand why it needs the -L > argument. I'll figure this out later. If I use -lglasPng.dll (additional > .dll) it doesn't work either. > Unix has standard places t

Re: [Haskell-cafe] using a win32 dll (Happy too soon)

2013-05-29 Thread Brandon Allbery
On Wed, May 29, 2013 at 9:40 AM, Kees Bleijenberg < k.bleijenb...@lijbrandt.nl> wrote: > If I compile with ghc --make testGlasPng.hs –lglasPng I get: ….\ld.exe: > cannot find –lglasPng. Collect 2: ld returned 1 exit status. > > ** > > Ld can’t find lglasPng (with the l in front, does it trim the l

Re: [Haskell-cafe] list comprehension doesn't work

2013-05-14 Thread Brandon Allbery
On Tue, May 14, 2013 at 11:17 AM, John wrote: > listPairs = [(a*b, y) | a <- [0..], b <- [0..], (a*b) > 5, (a*b) < 500, > (y*y) < 1001, mod y x == 0] > > Now I have it as you said, however the compiler complains about all y and x > and says they are NOT in scope. > > Why is it so? I can't see any

Re: [Haskell-cafe] ghci: Difference in garbage collection etc. between REPL and function

2013-05-09 Thread Brandon Allbery
On Thu, May 9, 2013 at 10:19 AM, Niklas Hambüchen wrote: > On 09/05/13 20:50, Brandon Allbery wrote: > > ghci is in many ways like an endless (or at least until ":l"/":r") > > do-block. In particular, the handle remains in scope after you run your > > com

Re: [Haskell-cafe] ghci: Difference in garbage collection etc. between REPL and function

2013-05-09 Thread Brandon Allbery
On Wed, May 8, 2013 at 9:54 PM, Niklas Hambüchen wrote: > If I run these steps one by one in ghci, garbage ends up in my handle as > expected. > > However, if I "let main = do ..." this whole block in order to pack it > in a test case, it does not happen, neither in ghci nor ghc. > ghci is in ma

Re: [Haskell-cafe] Fwd: Backward compatibility

2013-05-05 Thread Brandon Allbery
On Sun, May 5, 2013 at 7:55 AM, Raphael Gaschignard wrote: > Forgive me if I'm wrong, but I feel like I've seen such "suggestions" in > GHC errors before. > > If so, does that mean there's some sort of mechanism in the compiler > already in place for such error recognition? Like some simple patter

Re: [Haskell-cafe] runhaskell flags: What is going on?

2013-05-04 Thread Brandon Allbery
Bleh, I could have sworn that thing had a real usage message at some point...​ which means there is in fact a problem and you should file a bug against runhaskell. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listi

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread Brandon Allbery
On Fri, May 3, 2013 at 10:54 AM, Guy wrote: > http://hackage.haskell.org/**trac/ghc/wiki/**DefaultSuperclassInstances > > I'm surprised that the various superclass proposals haven't got more > attention, seeing as it would allow

Re: [Haskell-cafe] runhaskell flags: What is going on?

2013-05-03 Thread Brandon Allbery
On Fri, May 3, 2013 at 10:35 AM, Niklas Hambüchen wrote: > > runhaskell -fno-warn-unused-matches Myfile.hs > [some compile error] > > > runhaskell -fno-warn-unused-matches Myfile.hs > [no output whatsoever but exit code 127] > > > runhaskell -asdf Myfile.hs > ghc: unrecognised flags: -asdf > > >

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread Brandon Allbery
On Fri, May 3, 2013 at 5:30 AM, Adrian May wrote: > How about this: can you guys give me a detailed example of a justified > deprecation: one so extremely obviously called for that even I would agree. > I just want to understand the kind of logic that's applied over these > things. > This might n

Re: [Haskell-cafe] Backward compatibility

2013-05-02 Thread Brandon Allbery
On Thu, May 2, 2013 at 10:36 AM, Adrian May wrote: > I think you're missing the point of the platform! >> > > I suppose I did miss the point of the platform: I was trying to build it, > which requires at least part of the > Having to build it already indicates that something is wrong, unless you'

Re: [Haskell-cafe] Backward compatibility

2013-05-02 Thread Brandon Allbery
On Thu, May 2, 2013 at 1:27 AM, Adrian May wrote: > Let's face it: this decision to change the default syntax in GHC7 means > that right now Haskell looks about as stable as Ruby on Rails. > > I just tried to use Flippi. It broke because of the syntax change so I > tried WASH. I couldn't even inst

Re: [Haskell-cafe] Why were datatype contexts removed instead of "fixing them"?

2013-04-28 Thread Brandon Allbery
On Sun, Apr 28, 2013 at 3:59 AM, harry wrote: > Dan Doel gmail.com> writes: > > > However, another thing to consider is that getting rid of data type > contexts was accepted into the language standard. > > ... which means that implementers should be free to "fix" data type > contexts > however t

Re: [Haskell-cafe] Request for help: Recompile of ghc producing "...-ghc7.4.2.so"s, which break project builds.

2013-04-27 Thread Brandon Allbery
On Sat, Apr 27, 2013 at 11:47 AM, David Banas wrote: > dbanas@dbanas-lap:~/prj/AMI-Tool$ make > rm -f libami.so > ghc -o libami.so -shared -dynamic -package parsec -lHSrts -lm -lffi -lrt > AMIParse.o AMIModel.o ami_model.o ExmplUsrModel.o Filter.o > dbanas@dbanas-lap:~/prj/AMI-Tool$ > > > However

Re: [Haskell-cafe] Why were datatype contexts removed instead of "fixing them"?

2013-04-25 Thread Brandon Allbery
On Thu, Apr 25, 2013 at 6:38 AM, harry wrote: > If I understand correctly, the problem with datatype contexts is that if we > have e.g. > data Eq a => Foo a = Foo a > the constraint Eq a is thrown away after a Foo is constructed, and any > method using Foos must repeat Eq a in its type signatur

Re: [Haskell-cafe] cabal-install 1.16.0.2 on Mac

2013-04-11 Thread Brandon Allbery
ial reference on this, I can dig up the relevant Apple knowledge base article. > On 12/04/2013, at 2:44 AM, Brandon Allbery wrote: > (Newer Xcode should actually complain and tell you to run the removal script on startup, because its presence can even break Xcode under some circumstances.) &g

Re: [Haskell-cafe] cabal-install 1.16.0.2 on Mac

2013-04-11 Thread Brandon Allbery
On Thu, Apr 11, 2013 at 1:19 AM, Richard A. O'Keefe wrote: > On 11/04/2013, at 12:56 PM, Brandon Allbery wrote: > > Xcode 4.2 and on do not use /Developer at all. You have an older Xcode > on your system somehow, which does not understand newer object files; you > shou

Re: [Haskell-cafe] exp implementation

2013-04-11 Thread Brandon Allbery
On Thu, Apr 11, 2013 at 1:38 AM, Christopher Howard < christopher.how...@frigidcode.com> wrote: > Hi. For my own learning, I wanted to see how the exp function is > implemented in GHC. I have GHC 7.4.1 source code open, but I'm having > trouble figuring out which file the actual function definitio

Re: [Haskell-cafe] cabal-install 1.16.0.2 on Mac

2013-04-10 Thread Brandon Allbery
On Wed, Apr 10, 2013 at 8:36 PM, Richard A. O'Keefe wrote: > /Developer/usr/bin/strip: object: /home/cshome/o/ok/.cabal/bin/cabal > malformed object (unknown load command 15) > Xcode 4.2 and on do not use /Developer at all. You have an older Xcode on your system somehow, which does not understand

Re: [Haskell-cafe] Automated Differentiation of Matrices (hmatrix)

2013-04-10 Thread Brandon Allbery
On Wed, Apr 10, 2013 at 12:39 PM, Dominic Steinitz wrote: > :1:6: > Could not deduce (repa-3.2.3.1:Data.Array.Repa.Eval.Elt.Elt > (ad-3.4:Numeric.AD.Internal.Types.AD s a)) > > DANGER WILL ROBINSON! It's showing package names+versions on the types; this usually means y

Re: [Haskell-cafe] Bug in Network package

2013-04-10 Thread Brandon Allbery
On Wed, Apr 10, 2013 at 3:26 AM, Florian Hofmann < fhofm...@techfak.uni-bielefeld.de> wrote: > I might be mistaken, but is there a bug in the Show instance of PortNum? > Not a bug, an annoying misdesign (IMO). A PortNum is actually in network byte order. If you extract it, you get the original po

Re: [Haskell-cafe] llvm-3.0.1.0 installation on Mac

2013-04-08 Thread Brandon Allbery
On Mon, Apr 8, 2013 at 1:32 AM, Luke Evans wrote: > Unfortunately, it looks like > > /Library/Frameworks/GHC.framework/Versions/7.4.2-x86_64/usr/lib/ghc-7.4.2/libffi.dylib > is pointing to the dodgy library too, e.g.: > > > otool > -L > /Library/Frameworks/GHC.framework/Versions/7.4.2-x86_64/usr

Re: [Haskell-cafe] llvm-3.0.1.0 installation on Mac

2013-04-07 Thread Brandon Allbery
On Mon, Apr 8, 2013 at 12:10 AM, Luke Evans wrote: > Unfortunately, it looks like my cabal build failure occurs in a temporary > and very short-lived directory. So presumably the dodgy FFI gets copied > into there from elsewhere. I wonder if I can find the source... It's running an executable

Re: [Haskell-cafe] Why is "Cont" out of scope?

2013-04-02 Thread Brandon Allbery
On Tue, Apr 2, 2013 at 8:37 PM, Daryoush Mehrtash wrote: > I am trying to use the Cont in Control.Monad.Cont but it seems to be > missing > > Prelude> import Control.Monad.Cont > Prelude Control.Monad.Cont> :t Cont > > It's gone; try "cont" (lowercase). mtl2 replaced the old standalone monads wit

Re: [Haskell-cafe] Make a DSL serializable

2013-03-25 Thread Brandon Allbery
On Mon, Mar 25, 2013 at 8:53 AM, Corentin Dupont wrote: > Workflow is impressive! I didn't know you could serialize IO > states/computations. In certain constrained cases you can. General case, as I said earlier, is kinda impossible without serializing the entire machine state. -- brandon s al

Re: [Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Brandon Allbery
On Sun, Mar 24, 2013 at 5:44 PM, Corentin Dupont wrote: > But I always bothered me that this state is not serializable... I am not quite sure how to respond to that. You seem to be asking for magic. That kind of state has never been sanely serializeable. Not in Haskell, not anywhere else. The u

Re: [Haskell-cafe] Make a DSL serializable

2013-03-24 Thread Brandon Allbery
On Sun, Mar 24, 2013 at 4:16 PM, Corentin Dupont wrote: > Hi Daniel, > in my game the handlers are supplied by the players as part of little > programs that they submit. An haskell interpreter is reading the program > code submitted and inserts it in the game. > So there is an infinite number of h

Re: [Haskell-cafe] Enumerating functions at runtime

2013-03-23 Thread Brandon Allbery
On Sat, Mar 23, 2013 at 11:26 PM, Luke Evans wrote: > I'm curious about using Haskell for metaprogramming. > > It looks like I can dynamically compile, load and run some Haskell with > the plugins package. Actually I've briefly tried this and it seems to work > for some simple cases at least. >

Re: [Haskell-cafe] Compiled program using OpenGL fails to trigger GPU switch on Mac, but works in GHCi

2013-03-20 Thread Brandon Allbery
On Wed, Mar 20, 2013 at 9:02 AM, Jesper Särnesjö wrote: > This solution seems to work perfectly for me. Since the foreign code > is allowed to run uninterrupted, the GPU switch happens, and since the > GUI actions stay on the main thread, the program's window responds to > keyboard and mouse inpu

Re: [Haskell-cafe] Specialized Computer Architecture - A Question

2013-03-18 Thread Brandon Allbery
On Mon, Mar 18, 2013 at 4:31 PM, OWP wrote: > Let me rephrase that, of course they will survive politically. People > built these tools and if built, they will be use but will they survive > efficiently? In the future, if a particular specialized architecture > is somewhat better than the rest

Re: [Haskell-cafe] Compiled program using OpenGL fails to trigger GPU switch on Mac, but works in GHCi

2013-03-17 Thread Brandon Allbery
On Sun, Mar 17, 2013 at 7:58 PM, Jason Dagit wrote: > On Sat, Mar 16, 2013 at 6:53 PM, Jesper Särnesjö wrote: > >> To be clear, I think this isn't really an OpenGL problem, but rather >> one related to FFI or event handling. If anyone could explain to me,The >> release notes for 7.0.1 said this a

Re: [Haskell-cafe] cabal install oddities

2013-03-12 Thread Brandon Allbery
On Tue, Mar 12, 2013 at 3:21 PM, Tycho Andersen wrote: > Below is some sample output from a failing package: > > ps168825:~/playground$ cabal install network > Resolving dependencies... > Configuring network-2.4.1.2... > configure: WARNING: unrecognized options: --with-compiler, --with-gcc > chec

Re: [Haskell-cafe] Overloading

2013-03-12 Thread Brandon Allbery
On Tue, Mar 12, 2013 at 1:52 PM, Carlos Camarao wrote: > Sorry, I think my sentence: > "To define (+) as an overloaded operator in Haskell, > you have to define and use a type class." > is not quite correct. I meant that to define any operator in Haskell you > have to > have a type clas

Re: [Haskell-cafe] building darcs failed (Unable to link against the iconv library)

2013-03-03 Thread Brandon Allbery
On Sun, Mar 3, 2013 at 1:59 PM, Dmitry Malikov wrote: > On 03/03/2013 10:56 PM, Brandon Allbery wrote: > > On Sun, Mar 3, 2013 at 10:21 AM, Dmitry Malikov wrote: > >> checking whether to use -liconv... setup: Unable to link against >> the iconv library. >

Re: [Haskell-cafe] building darcs failed (Unable to link against the iconv library)

2013-03-03 Thread Brandon Allbery
On Sun, Mar 3, 2013 at 10:21 AM, Dmitry Malikov wrote: > checking whether to use -liconv... setup: Unable to link against > the iconv library. > Failed to install darcs-2.8.4 > cabal: Error: some packages failed to install: > > What is actually going on here? Iconv libraries a

Re: [Haskell-cafe] cabal install ghc-mod installs 3 years old version

2013-03-01 Thread Brandon Allbery
On Fri, Mar 1, 2013 at 12:08 PM, Albert Y. C. Lai wrote: > On 13-03-01 05:10 AM, Malcolm Wallace wrote: > >> Doesn't Cabal tend to install library packages under the .cabal folder? >> So blowing it away gets rid of the problematic ones. (And everything >> else.) >> > > You need to perform scien

Re: [Haskell-cafe] Question about forkIO

2013-02-28 Thread Brandon Allbery
On Thu, Feb 28, 2013 at 6:09 AM, C K Kashyap wrote: > Say I have a haskell function 'f' that does a forkIO and starts an action > "a". I create a DLL of this haskell code and inovke "f" from C. Can I > expect the "a" to continue to run once "f" has returned to C? > While you're off in C the I/O

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

2013-02-27 Thread Brandon Allbery
On Wed, Feb 27, 2013 at 8:37 AM, Corentin Dupont wrote: > Hi Chris, > Thanks! > That's true for the user number. What should I do? Encrypt it? It's not that you have a user number, or even that it's accessible: it's that it's the entirety of access control, meaning that if the user changes it th

Re: [Haskell-cafe] Parser left recursion

2013-02-24 Thread Brandon Allbery
On Sun, Feb 24, 2013 at 6:31 AM, Martin Drautzburg wrote: > Just a silly quick question: why isn't right-recursion a similar problem? > Very roughly: Left recursion is: let foo n = n + foo n in ... Right recursion is: let foo 1 = 1; foo n = n + foo (n - 1) in ... In short, matching the token

Re: [Haskell-cafe] Need urgent help with Network.tls

2013-02-23 Thread Brandon Allbery
On Sat, Feb 23, 2013 at 1:58 PM, C K Kashyap wrote: > What I am really looking for is a small sample code that demonstrates how > TLS package can be used to connect to a webserver or imapserver. > TLS isn't actually SSL, despite SSL getting blessed as "TLS 0.9". Various attempts at TLS-enabled w

Re: [Haskell-cafe] What is a Haskell way to implement flags?

2013-02-19 Thread Brandon Allbery
On Tue, Feb 19, 2013 at 10:11 AM, Branimir Maksimovic wrote: > In C usual way is to set some bit in integer variable by shifting or > oring, > and than check flag integer variable by anding with particular flag value. > What is Haskell way? > You can do that, but a somewhat more idiomatic way wo

Re: [Haskell-cafe] performance question

2013-02-13 Thread Brandon Allbery
On Wed, Feb 13, 2013 at 5:45 PM, wrote: > > On 13.02.2013 21:41, Brandon Allbery wrote: > >> The native solution is a parser like parsec/attoparsec. > > "Aleksey Khudyakov" replied > > > Regexps only have this problem if they are compiled from string.

Re: [Haskell-cafe] performance question

2013-02-13 Thread Brandon Allbery
On Wed, Feb 13, 2013 at 12:46 PM, David Thomas wrote: > The fact that parsec and attoparsec exist and can be pressed into service > with reasonable performance (I think?) on tasks for which regexps are > suitable is probably another big part of the reason no one's done it yet. > I expect much of

Re: [Haskell-cafe] performance question

2013-02-13 Thread Brandon Allbery
On Wed, Feb 13, 2013 at 11:32 AM, Nicolas Bock wrote: > Since I have very little experience with Haskell and am not used to > Haskell-think yet, I don't quite understand your statement that regexes are > seen as foreign to Haskell-think. Could you elaborate? What would a more > "native" solution l

Re: [Haskell-cafe] performance question

2013-02-13 Thread Brandon Allbery
On Tue, Feb 12, 2013 at 11:32 PM, wrote: > actualy native code compiler. Can't regex be done effectively in haskell > ? Is it something that can't be done, or is it just such minimal effort to > link to pcre that it's not worth the trouble ? > PCRE is pretty heavily optimized. POSIX regex eng

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

2013-02-09 Thread Brandon Allbery
On Sat, Feb 9, 2013 at 3:56 AM, Johan Holmquist wrote: > The code goes into production and, disaster. The new "improved" > version runs 3 times slower than the old, making it practically > unusable. The new version has to be rolled back with loss of uptime > and functionality and management is n

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

2013-02-06 Thread Brandon Allbery
On Wed, Feb 6, 2013 at 6:45 AM, Jan Stolarek wrote: > nevertheless I objected to his opinion, claiming that if compiler > performed such a high-level > optimization - replace underlying data structure with a different one and > turn one algorithm into > a completely different one - programmer wou

Re: [Haskell-cafe] Next Meetup

2013-02-04 Thread Brandon Allbery
On Mon, Feb 4, 2013 at 3:53 PM, Albert Y. C. Lai wrote: > Toronto is an international metropolis with three globally renowned > universities, multiple major-player high-tech labs, a world-class orchestra > and several world-class choirs, and fine cuisines from almost all cultures. > Toronto is ho

Re: [Haskell-cafe] linking errors while compile hugs98 in macos

2013-01-31 Thread Brandon Allbery
On Thu, Jan 31, 2013 at 10:15 PM, Junior White wrote: > So that lua best fits the rule very well, but i like haskell much more. > After doing some research, I find in the haskell world, there is a hugs > fits my demands. I'm sad to know that no one is maintaining hugs any more. > I asking someon

  1   2   3   4   >