Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Ross Mellgren
kqueue is the low level interface, but requires that you handle all file system events as they happen, and fast. There is a higher level interface called fsevents (with accompanying daemon fseventsd) which allows you a more calm way to read the file system events.

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Ross Mellgren
. This is my understanding, not having used either directly (I've only used inotify on linux). -Ross On Dec 4, 2009, at 11:39 AM, Svein Ove Aas wrote: On Fri, Dec 4, 2009 at 5:31 PM, Ross Mellgren rmm-hask...@z.odi.ac wrote: kqueue is the low level interface, but requires that you handle all file

Re: [Haskell-cafe] inotify-alike for mac os x?

2009-12-04 Thread Ross Mellgren
On Dec 4, 2009, at 5:30 PM, Bryan O'Sullivan wrote: On Fri, Dec 4, 2009 at 8:39 AM, Svein Ove Aas svein@aas.no wrote: That said.. you say you have to handle the events fast. What happens if you don't? If you don't handle events quickly, they're typically thrown away by the kernel

Re: [Haskell-cafe] module export question

2009-12-01 Thread Ross Mellgren
It looks like it is specified and the intended behavior: From the report, section 5.2: An algebraic datatype T declared by a data or newtype declaration may be named in one of three ways: The form T names the type but not the constructors or field names. The ability to export a type without

Re: [Haskell-cafe] Where is `newTVarIO` defined ?

2009-11-24 Thread Ross Mellgren
Control.Concurrent.STM On Nov 24, 2009, at 6:11 PM, zaxis wrote: I cannot hoogle it. It appears in Pugs: run' (-d:rest) = do info - fmap Just (io $ newTVarIO Map.empty) let ?debugInfo = info run' rest Sincerely! - fac n = foldr (*) 1 [1..n] -- View this

Re: [Haskell-cafe] Graph drawing library for Haskell

2009-11-20 Thread Ross Mellgren
I've written a simple incomplete binding to graphviz-as-a-library to do in-process graphviz layouts, though I would say it's hardly complete so I haven't released it. If it's useful to someone and they want to put in some additional elbow grease to make the particular features they want

Re: 32 to 64 bit problem

2009-11-15 Thread Ross Mellgren
Also /usr/bin/ghci, /usr/bin/runghc, /usr/bin/runhaskell to patch up all the holes. There may be others, also. Here is a reference to the original thread where someone found out SL broke GHC and then worked through temporarily resolving it:

Re: [Haskell-cafe] Why can `env` be assigned value two times ?

2009-11-14 Thread Ross Mellgren
They're two different 'env's, which can be observed by desugaring the do-notation: do env - liftIO (readIORef envRef) env - return (filter (\(_id, _) - _id /= id) env) ... Desugaring do-notation gets us: liftIO (readIORef envRev) = \ env - return (filter (\(_id, _) - _id /= id) env) = \ env

Re: [Haskell-cafe] Problem with JHC

2009-11-11 Thread Ross Mellgren
According to the paste you gave for the JHC test run: Here is what happens when I try to run it: phi...@desktop:~/jhctut$ ./jtree Give me a tree: T AND (L 1, L 2) jtree_code.c:2670: case fell off Aborted You gave it parens not square brackets. -Ross On Nov 11, 2009, at 11:45 AM, Philippos

Re: [Haskell-cafe] classes question

2009-11-09 Thread Ross Mellgren
You did not specify what type of number it is -- in Haskell numeric constants like 1 are actually typed as forall a. Num a -- that is, can be any type of Num. Try: plus (2::Int) 3 -Ross On Nov 9, 2009, at 1:44 PM, Paul Tokarev wrote: Hi. I am using Hugs 98 I have that piece of code:

Re: [Haskell-cafe] classes question

2009-11-09 Thread Ross Mellgren
a typeclass, instead just write the function directly -- plus :: Int - Int - Int plus = (+) -Ross On Nov 9, 2009, at 5:09 PM, Paul Tokarev wrote: Thanks, that works. But how sould I change my class definition, so that it works without (2::Int), but just with 2? Ross Mellgren wrote: You did

Re: [Haskell-cafe] Fortran mixed mode arithmetic expressions - Haskell

2009-10-26 Thread Ross Mellgren
http://www.haskell.org/onlinereport/basic.html 6.3 Standard Haskell Classes -Ross On Oct 26, 2009, at 3:13 PM, michael rice wrote: Got it. No doubt some of this figures into why I was beaten bloody by ghci last night. Is there a number tree somewhere that shows the heirarchy? Michael

Re: [Haskell-cafe] x - String

2009-10-16 Thread Ross Mellgren
Andrew has mentioned the debugger several times, NOT the interactive REPL. That is, using :-commands to inspect values. -Ross On Oct 16, 2009, at 2:46 PM, Daniel Peebles wrote: My GHCi can't do that :o I just wrote data A = B | C and loaded the file into GHCi. Typing B gives me:

Re: [Haskell-cafe] x - String

2009-10-16 Thread Ross Mellgren
No problem, just trying to make sure the conversation stays on track :-) -Ross On Oct 16, 2009, at 3:26 PM, Daniel Peebles wrote: Whoops, sorry about that then! On Fri, Oct 16, 2009 at 2:59 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: Andrew has mentioned the debugger several times

Re: [Haskell-cafe] Generating random enums

2009-10-16 Thread Ross Mellgren
I didn't try to compile this: import Control.Arrow (first) import System.Random (Random(..)) instance Random Dir where randomR (lo, hi) gen = first fromEnum (randomR (toEnum lo) (toEnum hi) gen) random gen = randomR (minBound, maxBound) But something along those lines should help

Re: [Haskell-cafe] Different semantics in identical do statement?

2009-10-09 Thread Ross Mellgren
In what Monad? -Ross On Oct 9, 2009, at 5:43 PM, staafmeister wrote: In my program do x - do blah - someFunc return blah return $ Constructor x behaves differently from do blah - someFunc return $ Constructor blah where the dots are identical. I would think that these programs

Re: [Haskell-cafe] Let it be

2009-10-08 Thread Ross Mellgren
You're running into this problem because you're in a do-block. In a do- block, all the continuing lines of a single statement in the do-block must be indented w/r/t to the first line. The cylinder example doesn't have this issue because it's not in a do-block. The layout rule (I'm

Re: [Haskell-cafe] Let it be

2009-10-08 Thread Ross Mellgren
I don't know of any offhand that specifically call it out -- it's a natural consequence of the layout rule which is described in the Haskell Report. However, there is at least one ticket in Haskell' to fix it for if/then/else: http://hackage.haskell.org/trac/haskell-prime/ticket/23 -Ross

Re: [Haskell-cafe] New to Haskell - List Comprehension Question

2009-10-07 Thread Ross Mellgren
I don't think a list comprehension is the easiest way to do it, how about upperCase :: String - String upperCase [] = [] upperCase (x:xs) = toUpper x : map toLower xs -Ross On Oct 7, 2009, at 4:48 PM, Steven1990 wrote: Hi, I'm currently learning Haskell, and I've been trying to work out a

Re: [Haskell-cafe] Creating an alias for a function

2009-10-06 Thread Ross Mellgren
car = head letting the compiler infer the type, or car :: [a] - a car = head for the explicit version. -Ross On Oct 6, 2009, at 10:01 PM, michael rice wrote: How do I create an alias for a function, like giving CAR the same functionality as HEAD. I know I can do it by creating a

Re: [Haskell-cafe] 16 bit floating point data in Haskell?

2009-09-27 Thread Ross Mellgren
What about the built-in Float type? Prelude Foreign.Storable sizeOf (undefined :: Float) 4 Prelude Foreign.Storable sizeOf (undefined :: Double) 8 Or maybe you mean something that can be used with FFI calls to C, in which case Foreign.C.Types (CFloat). Both instance the Floating, RealFloat,

Re: [Haskell-cafe] 16 bit floating point data in Haskell?

2009-09-27 Thread Ross Mellgren
. But these days I guess 32-bit is the minimum one would want to use? Most of the time I just use double anyway :) On Sun, Sep 27, 2009 at 9:47 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: What about the built-in Float type? Prelude Foreign.Storable sizeOf (undefined :: Float) 4 Prelude

Re: [Haskell-cafe] gtk2hs and runghc

2009-09-23 Thread Ross Mellgren
Well, keep in mind forkIO *might* be a different OS thread (unless it's bound, IIRC), depending on the number of workers (with -Nx) and so on. -Ross On Sep 23, 2009, at 2:24 PM, Günther Schmidt wrote: Am 23.09.2009, 19:29 Uhr, schrieb Duncan Coutts duncan.cou...@worc.ox.ac.uk : On Tue,

Re: [Haskell-cafe] Is it safe to use unsafePerformIO here?

2009-09-15 Thread Ross Mellgren
Ah yeah, that too. Control.Parallel.Strategies.rnf to the rescue? -Ross On Sep 15, 2009, at 4:17 PM, Cristiano Paris wrote: On Tue, Sep 15, 2009 at 10:12 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: Wouldn't seq b only force (at minimum) the first character of the file? I think it force

Re: [Haskell-cafe] Is it safe to use unsafePerformIO here?

2009-09-15 Thread Ross Mellgren
Ack, IGNORE ME! Way too strict. -Ross On Sep 15, 2009, at 4:20 PM, Ross Mellgren wrote: Ah yeah, that too. Control.Parallel.Strategies.rnf to the rescue? -Ross On Sep 15, 2009, at 4:17 PM, Cristiano Paris wrote: On Tue, Sep 15, 2009 at 10:12 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote

Re: [Haskell-cafe] Is it safe to use unsafePerformIO here?

2009-09-15 Thread Ross Mellgren
Wouldn't seq b only force (at minimum) the first character of the file? -Ross On Sep 15, 2009, at 4:08 PM, Cristiano Paris wrote: On Tue, Sep 15, 2009 at 9:29 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Dienstag 15 September 2009 21:13:02 schrieb Daniel Fischer: Still, the body

Re: [Haskell-cafe] problems with HOC install from svn

2009-09-08 Thread Ross Mellgren
It sounds like it's looking for the binary package -- you should install it using cabal, e.g. private (per-user) install: cabal update cabal install binary global (system-wide) install: sudo cabal update sudo cabal install --global binary -Ross On Sep 8, 2009, at 7:57 PM, John Velman wrote:

Re: [Haskell-cafe] problems with HOC install from svn

2009-09-08 Thread Ross Mellgren
(but not Cabal), and have been Xcoding with Objective C for a year or so now, but never tried this before. I am interested in HOC, but I've obviously got a lot to learn. Thanks again, John Velman On Tue, Sep 08, 2009 at 08:35:54PM -0400, Ross Mellgren wrote: It sounds like it's looking for the binary

Re: [Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread Ross Mellgren
My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have? -Ross On Aug 28, 2009, at 7:15 PM, David Leimbach wrote: Just thought I'd point out that my old GHC install is now broken by the update to Snow Leopard. Dave

Re: [Haskell-cafe] Snow Leopard Breaks GHC

2009-08-28 Thread Ross Mellgren
correct assembly code (it looks like). Dave On Fri, Aug 28, 2009 at 4:55 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have? -Ross On Aug 28, 2009, at 7:15 PM, David Leimbach wrote: Just

Re: [Haskell-cafe] Network.Socket error in MacOS 10.5?

2009-08-26 Thread Ross Mellgren
I don't think getNameInfo should work for for AF_UNIX -- the name given to SockAddrUnix is a file path, there is no name resolution. From the man page for getnameinfo(3) on OS X: NAME getnameinfo -- socket address structure to hostname and service name ... DESCRIPTION ... The

Re: [Haskell-cafe] A Question of Restriction

2009-07-26 Thread Ross Mellgren
I've seen this expressed with GADTs (which I guess many things can), though I'm not sure if it's the best way, and I'm no type system wizard. If I recall correctly, this use is normally called phantom types. {-# LANGUAGE EmptyDataDecls, GADTs #-} data Even data Odd data Foo a where

Re: [Haskell-cafe] YAHT Question about Exercise 4.8

2009-07-25 Thread Ross Mellgren
Cons 'a' (Cons 'b' (Cons 'c' Nil)) equivalent to 'a' : ('b' : ('c' : [])) using Haskell's normal list type. -Ross On Jul 25, 2009, at 2:55 AM, Futari wrote: Hi, I was trying to use the solution given, but I don't know how to use it... How do I create something that is of type List?

Re: [Haskell-cafe] A voyage of undiscovery

2009-07-16 Thread Ross Mellgren
It's not where -- let also works let { foo Prelude let { foo x = x } in (foo 1, foo True) (1,True) Can you send the code you're trying that doesn't work? -Ross On Jul 16, 2009, at 3:40 PM, Andrew Coppin wrote: Robert Greayer wrote: f0 _ = (foo True, foo 'x') where foo = id is well-typed.

Re: [Haskell-cafe] A voyage of undiscovery

2009-07-16 Thread Ross Mellgren
Is everything an acceptable answer? -Ross On Jul 16, 2009, at 6:38 PM, Derek Elkins wrote: On Thu, Jul 16, 2009 at 2:52 PM, Andrew Coppinandrewcop...@btinternet.com wrote: Ross Mellgren wrote: It's not where -- let also works Prelude let { foo x = x } in (foo 1, foo True) (1,True

Re: Re[2]: [Haskell-cafe] RE: Haskell as a first language?

2009-07-14 Thread Ross Mellgren
I agree -- I think the most major learning curve problem (for me) was not learning haskell directly, it was un-learning all those patterns and workarounds and so on from imperative/OOP languages. Of course, the only problem with learning haskell first is that one will probably be mildly

Re: [Haskell-cafe] Circular pure data structures?

2009-07-14 Thread Ross Mellgren
Yes, using lazy semantics. http://www.haskell.org/haskellwiki/Tying_the_Knot -Ross On Jul 14, 2009, at 6:27 PM, John Ky wrote: Hello, Is it possible to create a circular pure data structure in Haskell? For example: a :: Data let b = getNext a let c = getNext b c == a -- Gives True

Re: [Haskell-cafe] How to present the commonness of some objects?

2009-07-03 Thread Ross Mellgren
Wordy (and yet technically accurate) names aside, isn't this basically the same thing, except that you must pass the dictionary around by hand? What is the advantage of doing the dictionary passing manually, other than being able to avoid the scoping issue (that requires case) and the

Re: [Haskell-cafe] How to present the commonness of some objects?

2009-07-02 Thread Ross Mellgren
You have a couple problems here. The first is that GHC has no idea what particular type 'w' widgetList has, because the empty list is polymorphic. The second is that it looks like you probably want a heterogeneous list of widgets -- that is, possibly different types of widget as long as

Re: [Haskell-cafe] Cabal fun [Half-integer]

2009-06-29 Thread Ross Mellgren
I presume that many of the developers do not have windows machines (presumably because windows sucks). Maybe you could help them by trying to track down where the error in the code is, and even better yet submitting a patch? This is all free by the virtue of people giving what time they

Re: [Haskell-cafe] Type system trickery

2009-06-23 Thread Ross Mellgren
. The converse is true. Why would you want it to generate a polymorphic Foobar when it definitely is NoZoo? -Ross (p.s. the example names in this thread are a bit ridiculous ;-) ) On Jun 23, 2009, at 4:01 PM, Andrew Coppin wrote: Ross Mellgren wrote: This works for me: {-# LANGUAGE EmptyDataDecls

Re: [Haskell-cafe] Type system trickery

2009-06-22 Thread Ross Mellgren
This works for me: {-# LANGUAGE EmptyDataDecls, GADTs #-} module Main where data NoZoo data Zoo newtype X = X Int deriving (Show) newtype Y = Y Char deriving (Show) data Foobar a where Foo :: X - Y - Foobar NoZoo Bar :: X - Y - Foobar NoZoo Zoo :: Foobar NoZoo - Foobar Zoo foobar

Re: [Haskell-cafe] Obscure weirdness

2009-06-20 Thread Ross Mellgren
Really, without code or more than it just disappears, it's just conjecture what's happening. Can you post the code, or even better yet a minimized case that reproduces it? -Ross On Jun 20, 2009, at 1:34 PM, Andrew Coppin wrote: Alexander Dunlap wrote: On Sat, Jun 20, 2009 at 8:29 AM,

Re: [Haskell-cafe] IORef memory leak

2009-06-18 Thread Ross Mellgren
It looks offhand like you're not being strict enough when you put things back in the IORef, and so it's building up thunks of (+1)... With two slight mods: go 0 = return () go n = do modifyIORef ior (+1) go (n-1) -- go 0 = return () go n = do modifyIORef ior (\ x -

Re: [Haskell-cafe] IORef memory leak

2009-06-18 Thread Ross Mellgren
, 2009 at 9:55 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: It looks offhand like you're not being strict enough when you put things back in the IORef, and so it's building up thunks of (+1)... With two slight mods: go 0 = return () go n = do modifyIORef ior (+1) go (n-1

Re: [Haskell-cafe] Need some help with an infinite list

2009-06-16 Thread Ross Mellgren
Here's a way using list comprehensions: Prelude Data.List take 1000 $ concat.concat $ [ [ replicate n c | c - ['a'..'z'] ] | n - [1..] ] abcdefghijklmnopqrstuvwxyzaabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvw

Re: [Haskell-cafe] Re: Need some help with an infinite list

2009-06-16 Thread Ross Mellgren
Oh sorry about that, misread the problem. -Ross On Jun 16, 2009, at 9:16 PM, GüŸnther Schmidt wrote: Dear Ross, thanks for your post, you got it almost right, I needed something like aa, ab, ac ... It seems that Thomas has figured it out. Günther

Re: [Haskell-cafe] Cabal addressibility problem

2009-06-05 Thread Ross Mellgren
If your module statements say Swish in them, e.g. module Swish.HaskellUtils.TestHelpers where then you should probably have no hs-source-dirs (or hs-source-dirs: .) and then use Swish.HaskellUtils.TestHelpers. But leave Main-Is: as you have it. -Ross On Jun 5, 2009, at 4:49 PM,

Re: [Haskell-cafe] type checking that I can't figure out ...

2009-06-03 Thread Ross Mellgren
You've applied two solutions to get the value out -- pattern matching (Just reinfo) and fromJust. You should use one or the other, but not both: -- pattern matching remLookupFwd :: (ReVars m t) = SimplRe t - ReM m t (ReInfo t) remLookupFwd re = do fwd - gets resFwdMap let { Just

Re: [Haskell-cafe] comprehension problem

2009-06-03 Thread Ross Mellgren
P Float is the constructor to create a value of this type, similar to data declarations. That is, 0.5 :: Float, P 0.5 :: Probability The {} notation after D creates a record accessor, also similar to data declarations. It's equivalent to making an unD that unwraps the value yourself:

Re: [Haskell-cafe] type checking that I can't figure out ...

2009-06-03 Thread Ross Mellgren
True, so perhaps better written as: import Data.Maybe (fromMaybe) gets (fromMaybe (error could not find re in resFwdMap) . M.lookup re . resFwdMap) with more detail in error message as appropriate. -Ross On Jun 3, 2009, at 5:57 PM, Henning Thielemann wrote: Ross Mellgren schrieb

Re: [Haskell-cafe] Missing a Deriving?

2009-06-01 Thread Ross Mellgren
mplus is a method of class MonadPlus, so you need to write it in a separate instance from the one for Monad, e.g. instance MonadPlus Failable where mplus = ... -Ross On Jun 1, 2009, at 9:28 PM, michael rice wrote: Still stumped. Maybe and [] are in the same MonadPlus monad, but how do

Re: [Haskell-cafe] Missing a Deriving?

2009-06-01 Thread Ross Mellgren
it mplus)? Michael --- On Mon, 6/1/09, Ross Mellgren rmm-hask...@z.odi.ac wrote: From: Ross Mellgren rmm-hask...@z.odi.ac Subject: Re: [Haskell-cafe] Missing a Deriving? To: michael rice nowg...@yahoo.com Cc: haskell-cafe Cafe haskell-cafe@haskell.org Date: Monday, June 1, 2009, 9:33 PM mplus

Re: [Haskell-cafe] Random number example

2009-04-28 Thread Ross Mellgren
: From: michael rice nowg...@yahoo.com Subject: Re: [Haskell-cafe] Random number example To: Ross Mellgren rmm-hask...@z.odi.ac Cc: haskell-cafe@haskell.org Date: Thursday, April 23, 2009, 5:49 PM Hi Ross, Thanks for going the extra mile. A lot of what you did I haven't seen before, so it's going

Re: [Haskell-cafe] Re: Overriding a Prelude function?

2009-04-23 Thread Ross Mellgren
Hahah yeah of course, I left it implicit that you'd only do this if you were changing the types (e.g. parameterized monads or what have you) -Ross On Apr 23, 2009, at 5:15 AM, Heinrich Apfelmus wrote: Ross Mellgren wrote: True enough -- if you really want to redefine the monadic operator

Re: [Haskell-cafe] Random number example

2009-04-23 Thread Ross Mellgren
So there are a couple problems. First is you are trying to rebind prelude functions, when instead you should be creating an instance of Monad. This requires a bit of shuffling because without language extensions you can't instance Monad Random for your type of Random, as it is a type

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread Ross Mellgren
I think import Prelude hiding (()) does that. -Ross On Apr 22, 2009, at 11:44 AM, michael rice wrote: I've been working through this example from: http://en.wikibooks.org/wiki/Haskell/Understanding_monads I understand what they're doing all the way up to the definition of (), which

Re: [Haskell-cafe] Overriding a Prelude function?

2009-04-22 Thread Ross Mellgren
], whereas you might have hoped for [3,4] [5] = error Call me! Dan Ross Mellgren wrote: I think import Prelude hiding (()) does that. -Ross On Apr 22, 2009, at 11:44 AM, michael rice wrote: I've been working through this example from: http://en.wikibooks.org/wiki/Haskell/Understanding_monads I

Re: [Haskell-cafe] Getting the x out

2009-04-21 Thread Ross Mellgren
If you want to just get the value out, meaning you'll get a program error if it happens to be Nothing, then you can use Data.Maybe.fromJust. But usually, you'd want to preserve the Nothing. Applicative or Monad is pretty good for this: import Control.Applicative (3+) $ safeDivision 10 5

Re: [Haskell-cafe] Funny type signature question

2009-04-02 Thread Ross Mellgren
There's nothing connecting the Enum/Bounded used in fromEnum and min/ maxBound to the toEnum, as there's an Int in the middle. Annotated very explicitly, the type inferrer probably sees something like: randomEnum :: (Enum a, Bounded a, RandomGen g) = Rand g a randomEnum = do let minb =

Re: [Haskell-cafe] ANNOUNCE: vacuum-cairo: a cairo frontend to vacuum for live Haskell data visualization

2009-03-31 Thread Ross Mellgren
Unfortunately the .DMG based frameworks do not have the cairo svg framework (or the opengl framework), and it's non-trivial to get it added on. If you need it, best bet right now is probably to go for a macports install. -Ross On Mar 31, 2009, at 8:01 AM, Sebastian Fischer wrote: On

Re: [Haskell-cafe] ANN: cmonad 0.1.1

2009-03-30 Thread Ross Mellgren
I think my brain just exploded. On Mar 30, 2009, at 1:29 PM, Edward Kmett wrote: First, BASIC, now C. What's next, Haskell? =) -Edward Kmett On Sun, Mar 29, 2009 at 5:16 AM, Lennart Augustsson lenn...@augustsson.net wrote: I've uploaded my CMonad package to Hackage. It allows you to

Re: [Haskell-cafe] Rational and % operator remix

2009-03-29 Thread Ross Mellgren
I think you probably mean ==, the comparison operator (function), not = (assignment in let-forms or where-forms) -Ross On Mar 29, 2009, at 1:40 PM, michael rice wrote: Hi, Thanks again for the help last night. The second function cf2 is an attempt to reverse the process of the first

Re: [Haskell-cafe] Something wrong with happs.org?

2009-03-24 Thread Ross Mellgren
I thought that HAppS has gone, replaced by happstack? http://happstack.com/ -Ross On Mar 24, 2009, at 11:32 AM, Vimal wrote: Hi, http://happs.org/ has some Javascript visible as plain text. It looks like some tags are missing in the page... I hope that's the right website, because it

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Ross Mellgren
Doesn't matter how many times you seq the results, the thunk has been forced. -Ross On Mar 24, 2009, at 4:45 PM, FFT wrote: I demand a recount! The one that launches the missile should have won! 2009/3/24 Eelco Lempsink ee...@lempsink.nl: The results of the Haskell logo competition are

Re: [Haskell-cafe] The votes are in!

2009-03-24 Thread Ross Mellgren
import Diebold.Unsafe (unsafeChangeVotes) ... ? -Ross On Mar 24, 2009, at 4:47 PM, John Van Enk wrote: Unless there's a rogue unsafeChangeVotes call in there somewhere. On Tue, Mar 24, 2009 at 4:46 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: Doesn't matter how many times you seq

Re: [Haskell-cafe] about Haskell code written to be too smart

2009-03-24 Thread Ross Mellgren
As (yet another?) Haskell newbie, with a day job using Java (where keep it simple, stupid is not a principle, it's a language enforced requirement), I would much prefer the function is implemented in the most concise and idiomatic style that the writer is capable of. That is, either the

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
Paul Adams wrote: Ross == Ross Mellgren rmm-hask...@z.odi.ac writes: Ross While there is not a .dmg for Gtk2Hs, you can use a .dmg Ross installed GHC with a .dmg installed Gtk, and then build Ross gtk2hs straight on top of that, without having to deal with Ross the dual-GHC macports

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
Minor correction -- pango in general is installed with the .DMG of Gtk... it's pangoft2 (the freetype2 bindings) that librsvg requires and aren't provided. -Ross On Mar 21, 2009, at 12:35 PM, Ross Mellgren wrote: I tried making this work, but librsvg requires pango, and pango is a huge

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
be identifiers. I think I've seen this before - some well-known Mac OSX problem? (I'm a linux man myself - so I'm not used to the mac) 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac: I tried making this work, but librsvg requires pango, and pango is a huge pain in the ass -- I managed to get

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac: I think there must be a version inconsistency with your GLib framework -- either not the most recent copy of the GTK+ DMG, or your path is flipped around and you're using a ports version. Run glib-mkenums --version to see what version you have... I

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
doesn't find it. 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac: (back to the list) Answers inline: On Mar 21, 2009, at 2:42 PM, Colin Adams wrote: Yes, that was the problem, and swapping the PATH order does the trick. Thanks. no prob. I must still have the macports stuff installed. Can

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-21 Thread Ross Mellgren
wrote: And the reason is that librsvg fails to find cairo, pangocairo and cairo-png. Where is it supposed to find them? 2009/3/21 Colin Adams colinpaulad...@googlemail.com: It didn't. 2009/3/21 Ross Mellgren rmm-hask...@z.odi.ac: Did the configure for gtk2hs claim that it was going to build

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Ross Mellgren
While there is not a .dmg for Gtk2Hs, you can use a .dmg installed GHC with a .dmg installed Gtk, and then build gtk2hs straight on top of that, without having to deal with the dual-GHC macports mess.. http://www.haskell.org/haskellwiki/Gtk2hs#Using_the_GTK.2B_OS_X_Framework -Ross On Mar

Re: [Haskell-cafe] Ease of Haskell development on OS X?

2009-03-20 Thread Ross Mellgren
ForeignFunctionInterface#-} instead package.conf.inplace: openBinaryFile: does not exist (No such file or directory) make[1]: *** [glib/System/Glib.o] Error 1 make: *** [all] Error 2 On Fri, Mar 20, 2009 at 2:27 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: While there is not a .dmg for Gtk2Hs, you can use a .dmg

Re: [Haskell-cafe] Status of Haskell under OsX

2009-03-02 Thread Ross Mellgren
I use this configuration exclusively... it wasn't actually that hard to set up once I found out that the .pc files are shipped in a strange directory buried in the frameworks. I posted how I got it working back in December:

Re: [Haskell-cafe] ANN: gitit 0.5.1

2009-02-26 Thread Ross Mellgren
Are you by chance using OSX? The file you attached was not a plain text file -- it was an RTF file. If you made this file on OSX and forgot to invoke the Format Make Plain Text command, it'll be an RTF file which I'm sure gitit will have no clue about. -Ross On Feb 26, 2009, at 10:21

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-25 Thread Ross Mellgren
I use Haskell under OSX only. I find it very well supported. -Ross On Feb 25, 2009, at 2:37 PM, Cristiano Paris wrote: Hi, I'm planning to purchase a MacBookPro so I'm wondering how well Haskell is supported under this platform. Thanks, Cristiano

Re: Re[6]: [Haskell-cafe] Re: speed: ghc vs gcc

2009-02-20 Thread Ross Mellgren
Now perhaps I'll be stepping into some lines of fire as it seems like this thread is full of them. If I get in anyone's way please kindly hold your shot ;-) That said, video codecs are the kinds of things that usually benefit greatly from vectorization and parallelization right? These are

Re: [Haskell-cafe] ANN : happs-tutorial 0.7

2009-02-11 Thread Ross Mellgren
This is a known issue: http://hackage.haskell.org/trac/ghc/ticket/1993 Try: cabal install --ghc-options=-fregs-graph Crypto and then try installing happs-tutorial again. -Ross On Feb 11, 2009, at 4:31 PM, Daryoush Mehrtash wrote: When i try to cabal install happs-tutorial I get the

Re: [Haskell-cafe] Additonal types for Foreign.C.Types

2009-02-10 Thread Ross Mellgren
I think you can use Data.Word and Data.Int types for this, that is. Data.Word.Word16 == uint16_t, Data.Word.Word32 == uint32_t, etc. Data.Int.Int16 = int16_t, Data.Int.Int32 = int32_t, etc. There are Foreign.Storable.Storable instances for those. -Ross On Feb 10, 2009, at 6:32 AM, Maurí cio

Re: [Haskell-cafe] Re: Additonal types for Foreign.C.Types

2009-02-10 Thread Ross Mellgren
The FFI spec says (at http://www.cse.unsw.edu.au/~chak/haskell/ffi/ffi/ffise3.html#x6-120003.2) : The argument types at[i] produced by fatype must be marshallable foreign types; that is, each ati is either (1) a basic foreign type or (2) a type synonym or renamed datatype of a marshallable

Re: [Haskell-cafe] Re: Additonal types for Foreign.C.Types

2009-02-10 Thread Ross Mellgren
fatype is the function argument type. atype[i] are type arguments. qtycon is a qualified (e.g. possibly with module prefix) type constructor, e.g. Just So, for example if you have: foreign import ccall string.h strlen cstrlen :: Ptr CChar - IO CSize fatype - ftype :: ftype fatype ::

Re: [Haskell-cafe] about integer and float operations

2009-02-04 Thread Ross Mellgren
Prelude let i2fDiv a b = fromIntegral a / fromIntegral b Prelude :t i2fDiv i2fDiv :: (Integral a, Fractional b, Integral a1) = a - a1 - b Prelude 10 `i2fDiv` 3 3.3335 That what you're looking for? -Ross On Feb 4, 2009, at 4:22 PM, Manlio Perillo wrote: Manlio

Re: [Haskell-cafe] why typeRepArgs (typeOf hello) is [Char] ?

2009-02-02 Thread Ross Mellgren
The type of hello is String, which is [Char], which is really [] Char (that is, the list type of kind * - *, applied to Char). 1, 'a', and True are all simple types (I'm sure there's a more particular term, maybe monomorphic?) with no type arguments. [] has a type argument, Char.

Re: [Haskell-cafe] why typeRepArgs (typeOf hello) is [Char] ?

2009-02-02 Thread Ross Mellgren
to the second element of the list (if any) (here, Integer - Integer). It worked well until I tried it on a function like :: Char - Int - [Char] where the last recursive call gives [Char] instead of []. Is it possible to write such a function ? Thank you, Thu 2009/2/2 Ross Mellgren rmm-hask

Re: [Haskell-cafe] C-like Haskell

2009-01-28 Thread Ross Mellgren
Duncan, I think you must have some magics -- on my machine the original code also takes forever. Running with +RTS -S indicates it's allocating several gig of memory or more. Applying some bang patterns gives me ~8s for 10^8 and somewhat more than a minute for 10^9: {-# LANGUAGE

[Haskell-cafe] Re: C-like Haskell

2009-01-28 Thread Ross Mellgren
Yeah, you know after sending the email (never a better time) I noticed that the C version wasn't spitting out the right answer. I'm not really sure why, I just replaced bigint with int64_t from stdint.h. -Ross On Jan 28, 2009, at 8:32 PM, Benedikt Huber wrote: Ross Mellgren schrieb

Re: [Haskell-cafe] C-like Haskell

2009-01-28 Thread Ross Mellgren
Apparently 64-bit GHC is sufficiently advanced to be indistinguishable from magic. Now, if only there was a 64-bit binary for Mac OS X :-/ -Ross On Jan 28, 2009, at 9:06 PM, Jake McArthur wrote: Ross Mellgren wrote: Duncan, I think you must have some magics -- on my machine the original

[Haskell-cafe] Template Haskell very wordy w/r/t Decs and Types

2009-01-25 Thread Ross Mellgren
Hi all, I'm writing a small module that exposes a template haskell splice that takes a (very simplified) C struct definition and builds: - A data type definition, - an instance for Data.Binary.Binary, - and optionally a pretty print function for it However, it seems to do this I have to

Re: [Haskell-cafe] Generalizing a filter-making function

2009-01-23 Thread Ross Mellgren
makeFilter :: (b - b - Bool) - (a - b) - b - a - Bool makeFilter (==) proj expected = (expected ==) . proj makeEqFilter :: Eq b = (a - b) - b - a - Bool makeEqFilter = makeFilter (==) Then you have a foo: data Foo = Foo { fooA :: String, fooB :: Int } foos = [Foo a 1, Foo b 2] filter

Re: [Haskell-cafe] Generalizing a filter-making function

2009-01-23 Thread Ross Mellgren
, however, so I'm not sure it's entirely necessary. Thanks again. On Fri, Jan 23, 2009 at 05:39:07PM -0500, Ross Mellgren wrote: makeFilter :: (b - b - Bool) - (a - b) - b - a - Bool makeFilter (==) proj expected = (expected ==) . proj makeEqFilter :: Eq b = (a - b) - b - a - Bool makeEqFilter

Re: [Haskell-cafe] OS X build failure of Gtk2Hs from MacPorts

2009-01-17 Thread Ross Mellgren
I personally spurned MacPorts for this reason (and others). I've had good success using the GTK+ Aqua framework from http://www.gtk- osx.org/ and manually compiling pkg-config and gtk2hs from the darcs repository. The only trick was to set PKG_CONFIG_PATH appropriately before running

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Ross Mellgren
For what it's worth, many (most/all?) programmers I know in person don't have the slightest clue about Category Theory and they may have known about abstract algebra once upon a time but certainly don't remember any of it now. They usually understand the concepts perfectly well enough but

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Ross Mellgren
to convey the meaning of it and gives an example. -- Lennart On Thu, Jan 15, 2009 at 4:46 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: For what it's worth, many (most/all?) programmers I know in person don't have the slightest clue about Category Theory and they may have known about abstract

Re: [Haskell-cafe] Comments from OCaml Hacker Brian Hurt

2009-01-15 Thread Ross Mellgren
On Jan 15, 2009, at 1:21 PM, David Menendez wrote: On Thu, Jan 15, 2009 at 11:46 AM, Ross Mellgren rmm- hask...@z.odi.ac wrote: Second is that there appears to be no way to document an _instance_. It would be really handy if there were even a single line under Instances Monoid

Re: [Haskell-cafe] nested function application question

2009-01-05 Thread Ross Mellgren
Did you mean: B.intercalate (B.intercalate ByteString [ByteString]) [ByteString] ($) applies all the way to the right, so you were giving the inner intercalate two lists of ByteString. -Ross On Jan 5, 2009, at 1:17 PM, Galchin, Vasili wrote: Hi Max, That is what should happen

Re: [Haskell-cafe] nested function application question

2009-01-05 Thread Ross Mellgren
, Jan 5, 2009 at 12:18 PM, Ross Mellgren rmm- hask...@z.odi.ac wrote: Did you mean: B.intercalate (B.intercalate ByteString [ByteString]) [ByteString] ($) applies all the way to the right, so you were giving the inner intercalate two lists of ByteString. -Ross On Jan 5, 2009, at 1:17 PM

Re: [Haskell-cafe] Trouble with the ST monad

2008-12-29 Thread Ross Mellgren
On Dec 29, 2008, at 3:43 PM, Andre Nathan wrote: On Mon, 2008-12-29 at 14:19 -0500, Ross Mellgren wrote: The problem is that you're trying to take a STMatrix from some other ST computation and freeze it in a new ST computation. The isolation between separate computations is done via the rank-2

Re: [Haskell-cafe] Time for a new logo?

2008-12-16 Thread Ross Mellgren
It does require a mathematical mind, but does not require that you understand the mathematical language. If mathematics are the basis of computation, and programming is an implementation of computation, then in many ways programming languages are a (less powerful) equivalent language to

  1   2   >