Re: [Haskell-cafe] Re[4]: [Haskell] Google Summer of Code

2009-02-12 Thread Claus Reinke
> Check out what GHC is doing these days, and come back with an analysis > of what still needs to be improved. We can't wait to hear! can you point me to any haskell code that is as fast as it's C equivalent? You should do your own benchmarking! Please, folks! This is hardly helpful. It isn't

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

2009-02-20 Thread Claus Reinke
Concrete examples always help, thanks. Turning this into a ticket with associated test will: - enable others to find and repeat the test when this thread is long gone, to see whether any other ghc changes have helped in any way - enable documentation of what exactly the issue is (why is it sl

Re: [Haskell-cafe] Hoogle and Network.Socket

2009-02-20 Thread Claus Reinke
> 1) Show all the functions (when the number is low), but place platform > specific functions under separate headers: "Windows", > "Linux/BSD/POSIX", "OS X", etc. If a function isn't available on all OS's then all Hoogle would be encouraging you to do is break compatibility and stop me from using

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

2009-02-20 Thread Claus Reinke
Turning this into a ticket with associated test will: but why you think that this is untypical and needs a ticket? ;) Because generally ghc is doing a good-enough job. And it is doing that because long ago, ghc hq's war cry was "if ghc generates code that is slower than any other haskell imple

Re: [Haskell-cafe] Hoogle and Network.Socket

2009-02-22 Thread Claus Reinke
sitting in a pub with some beer having a platform war). Martijn's thoughts of +windows, +unix, +os is exactly right, I'm happy to let users say "oh, please show me these packages", but there are trade-offs in Hoogle design. If someone has some clear viewpoint on the answers, I'd love to hear them.

Re: Re[2]: Pickling a finite map (Binary + zlib) [was: [Haskell-cafe]Data.Binary poor read performance]

2009-02-24 Thread Claus Reinke
btw, i always thought that it should be a way to overcome any export lists and go directly to module internals. limiting export is the way to protect programmer from errors, not security feature, and it should be left to programmer to decide when he don't need it. compilers should just be able to

Re: [Haskell-cafe] ANNOUNCE: Extensible and Modular Generics for theMasses: emgm-0.3

2009-03-03 Thread Claus Reinke
Due to a problem with the template-haskell package and Cabal, you cannot cabal-install the emgm package with GHC 6.8. However, take heart! EMGM works very well with GHC 6.8. You merely have to download the tar.gz package from Hackage yourself, build it, and install it. I thought I had seen you m

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-03 Thread Claus Reinke
At first guess it sounds like you're holding onto too much, if not the whole stream perhaps bits within each chunk. It is possible. I split the string in lines, then map some functions on each line to parse the data, and finally calling toU, for converting to an UArr. Just to make sure (cod

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-03 Thread Claus Reinke
I split the string in lines, then map some functions on each line to parse the data, and finally calling toU, for converting to an UArr. Just to make sure (code fragments or, better, reduced examples would make it easier to see what the discussion is about): are you forcing the UArr to be const

Re: [Haskell-cafe] possible memory leak in uvector 0.1.0.3

2009-03-03 Thread Claus Reinke
That helps to make things clearer, I think. One issue is the nature of Maps (strict in keys, non-strict in values). - neither singleton nor unionWith are strict in the Map values, so nothing here forces the evaluation of rate or constructionof UArr But, as I have written, in one of my tes

Re: [Haskell-cafe] bytestring vs. uvector

2009-03-08 Thread Claus Reinke
uvector is, if my memory serves me correctly, a fork of the vector library. It uses modern stream fusion, but is under active development and is a little scary. I'm a little unclear on the exact difference between uvector and vector. Both use arrays that are not pinned, so they can't be readily us

Re: [Haskell-cafe] Looking for literature

2009-03-08 Thread Claus Reinke
I'm trying to catch up with all the wonderful Haskell Types, classes, Abstract Data Types, Algebraic Data Types, Types that give peoples headaches and all the other, deeper stuff I have been happily putting off. Hmm, do we need more pragmas?-) {-# LANGUAGE TypesThatGivePeopleHeadaches #-} {-#

Re: [Haskell-cafe] Re: Sugestion for a Haskell mascot

2009-03-12 Thread Claus Reinke
I agree that looking for a mascot that is inspired by "laziness" is a bad idea from a P.R. perspective (I am tired of people walking out the room when I give Haskell talks to general audiences and explain lazy evaluation). Do they walk out when you mention it or when you explain it?-) Lazy eva

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Claus Reinke
I'm getting a runtime failure "Error in array index". This causes ghci to exit. Is there a way to get it to break instead, so I can find out which function is failing? i recall two techniques - one is trivially define your own (!) and print index at least. another is to use ghc profiling with

Re: [Haskell-cafe] How to catch error in array index when debugging

2009-03-14 Thread Claus Reinke
Claus> None of which is satisfactory. You might also want to add Claus> yourself to this ticket: Claus>"index out of range" error message regression Claus> http://hackage.haskell.org/trac/ghc/ticket/2669 How do I do that? Ghc Trac's idea of voting is by adding yourself to the c

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-15 Thread Claus Reinke
main = do r <- newIORef 0 v <- unsafeInterleaveIO $ do writeIORef r 1 return 1 x <- case f v of 0 -> return 0 n -> return (n - 1) y <- readIORef r print y -- a couple of examples: f x = 0 -- program prints "0" -- f x = x -- program prints "1"

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-16 Thread Claus Reinke
> > "exception handling" which allows to "catch" programming errors. > And which I have a sneaking suspicion actually *is* `unsafe'. Or, at > least, incapable of being given a compositional, continuous semantics. "A semantics for imprecise exceptions" http://research.microsoft.com/en-us/um/people

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-17 Thread Claus Reinke
So that first step already relies on IO (where the two are equivalent). Come again? The first step in your implication chain was (without the return) throw (ErrorCall "urk!") <= 1 ==> evaluate (throw (ErrorCall "urk!")) <= evaluate 1 but, using evaluation only (no context-sensitive IO),

[Haskell-cafe] Re: Go Haskell!

2009-03-18 Thread Claus Reinke
e a nice library API on top of this and upload it to hackage, I'd be delighted. Hack away. A GTP interface would be useful, to allow playing against other bots. Cheers, Simon Simon Marlow wrote: Claus Reinke wrote: Do you have an example of a mutable state/ IO bound application, like,

Re: [Haskell-cafe] What unsafeInterleaveIO is unsafe

2009-03-19 Thread Claus Reinke
arch.microsoft.com/en-us/um/people/simonpj/papers/marktoberdorf/ [1] Concurrent Haskell, Peyton Jones, Gordon, Finne http://research.microsoft.com/en-us/um/people/simonpj/papers/concurrent-haskell.ps.gz [2] A semantics for imprecise exceptions, Peyton Jones, Reid, Hoare, Marlow, Henderson ht

Re: [Haskell-cafe] Re: A guess on stack-overflows - thunks build-upand tail recursion

2009-03-20 Thread Claus Reinke
The problem occurs when the result value is needed and thus the thunks need to be reduced, starting with the outermost, which can't be reduced without reducing the next one etc and it's these reduction steps that are pushed on the stack until its size cause a stack-overflow. Yes, tha

Re: [Haskell-cafe] Re: A guess on stack-overflows - thunksbuild-upand tail recursion

2009-03-20 Thread Claus Reinke
It would be great to have a video of this in action up on youtube. You can simply 'recordmydesktop' on linux (and likely elsewhere), then upload the result. I'm curious: how would a non-interactive animation running in Flash in a browser be better than an interactive animation running in Java in

Re: [Haskell-cafe] Re: A guess on stack-overflows - thunksbuild-upandtail recursion

2009-03-22 Thread Claus Reinke
l visualizations, careful setup is needed to reveal the points of interest - other ways of instrumenting the code or providing input files would have been possible, but less helpful). As mentioned before (and below), the paper goes into more detail on GHood itself. Claus With that said, I think the

Re: [Haskell-cafe] about beta NF in lambda calculus

2009-03-22 Thread Claus Reinke
If above is true, I am confused why we have to distinguish the terms which have NF and be in NF? isn't the terms have NF will eventually become in NF? or there are some way to avoid them becoming in NF? Another way to think about it: what about terms which have no NF? And given both kinds of ter

Re: [Haskell-cafe] Making videos of your project

2009-03-24 Thread Claus Reinke
Perhaps the "make a video" slogan doesn't quite explain what is intended - it didn't to me!-) Reading John Udell's short article What is Screencasting? http://www.oreillynet.com/pub/a/oreilly/digitalmedia/2005/11/16/what-is-screencasting.html?page=1 gave me a better idea: the screen video part i

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

2009-03-25 Thread Claus Reinke
The beauty of functional programming is that there doesn't have to be a conflict between those who prefer explicit and those who prefer implicit recursion. Think of them as different views on the same functions - just as with graphical visualizations, pick the view best suited to your purpose and

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

2009-03-26 Thread Claus Reinke
Continuing our adventures into stylistic and semantic differences:-) Comparing the 'State' and explicit recursion versions takeListSt = evalState . mapM (State . splitAt) -- ..with a derivation leading to.. takeListSt []s = [] takeListSt (h:t) s = x : takeListSt t s' where

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-26 Thread Claus Reinke
safeDiv :: (Exception e, Integral a) => a -> a -> Either e a safeDiv x y = unsafePerformIO . try . evaluate $ div x y I just want to know, from a theoretical point of view, whether this 'safeDiv' in above definition is the same as safeDiv' :: (Exception e, Integral a) =>

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

2009-03-27 Thread Claus Reinke
Continuing our adventures into stylistic and semantic differences:-) Can you write this analysis on the wiki? Hmm, we tried that in the past, and I haven't seen any indication that people search for those things, let alone find them (one particular example I recalled I still haven't been able

Re: [Haskell-cafe] Template Haskell messes up scoping?

2009-03-29 Thread Claus Reinke
It looks like the scope is interrupted just above $( ... ) - but I'd like to know why and find a more beautiful way than just moving all th calls to the bottom of the module file :) Top-level splices can introduce bindings. IIRC, the current TH implementation uses a simple sequencing approach,

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-29 Thread Claus Reinke
IntMap (UArr (Word16 :*: Word8)) I was adding elements to the map using something like: v = map singletonU (a :*: b) insertWith appendU k v m However doing this eats a *lot* of memory. Since 'insertWith' doesn't actually do the 'appendU', the appends will also be compressed in ti

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-29 Thread Claus Reinke
But Claus was right, appendU is lazy; this seems to be the cause of the problem. appendU is strict, insertWith just doesn't force it (follow the source link in the haddocks to see why). However now I don't really understand why the two implementations differs in lazyness. Or, to ask a differ

Re: [Haskell] Re: [Haskell-cafe] ANN: cmonad 0.1.1

2009-03-30 Thread Claus Reinke
| When I looked at it a year ago or so, it was a return of one | constructor in a sum. | Looking at core, you can see several places where a function is called | and that function always returns the same constructor, so the case | analysis of the return value is not needed; it should be returned a

Re: [Haskell-cafe] Re: A guess on stack-overflows - thunks build-up andtail recursion

2009-03-30 Thread Claus Reinke
I wonder if I could write some sort of "chunked fold" which basically still produces the same amount of thunks but in a way so that the do not go on the stack all at once for reduction and thus do not cause a stack overflow. Kind of a tree. Not without re-associating the applications of the op

Re: [Haskell-cafe] type-level programming support library

2009-03-30 Thread Claus Reinke
I suppose having a good description of what I'd like to do might help: I'd like to be able to make an N-Tuple an instance of a type class. class Foo a where instance Foo (,) where instance Foo (,,) where The different kindedness of (,) and (,,) prevent this from working. Not that this i

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-31 Thread Claus Reinke
appendU is strict, insertWith just doesn't force it (follow the source link in the haddocks to see why). Ok, I see. But, IMHO, this should be clearly documented. There seems to be some agreement that strict variant operations should also be provided, but it needs some more thinking, and whenev

Re: [Haskell-cafe] uvector package appendU: memory leak?

2009-03-31 Thread Claus Reinke
Can I close this ticket as not being to do with uvector? -- Don You did notice the suggestion that performance of uvector and bytestring could be improved drastically if compile-time fusion would be augmented with runtime fusion? Claus http://www.haskell.org/pipermail/haskell-cafe/2009-March

Re: [Haskell-cafe] Making videos of your project

2009-03-31 Thread Claus Reinke
Is there anyone here with experience in screencasting of text-based applications, who could offer advice on how to produce screencasts on windows/xp? The basic screencasting (capture+annotation/editing) is not the problem, eg, CamStudio seems ok, and Wink gives me more control for mostly input-dri

Re: [Haskell-cafe] Is there a way to see the equation reduction?

2009-04-01 Thread Claus Reinke
But I am more interested in seeing the expansion and reduction that the execution encounters as it lazily evaluates the function. Have you tried GHood? examples: http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/GHood/ package: http://hackage.haskell.org/cgi-bin/hackage-scripts/

Re: [Haskell-cafe] Looking for practical examples of Zippers

2009-04-01 Thread Claus Reinke
my quest for data structures continues. Lately I came across "Zippers". Can anybody point be to some useful examples? Once upon a time, there was a hardware implementation of a lambda calculus based functional language (mostly, I was told, to show that it could be done:-). The program representa

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

2009-04-01 Thread Claus Reinke
Did you use hubigraph? http://ooxo.org/hubigraph/ Ah, there it is, then. Btw, more interesting than the 3d nature of the visualizations is that Ubigraph seems to have been designed for incremental updates of the layout (see the paper available via their home site). The lack of support for th

Re: [Haskell-cafe] Reverting to any old version using Darcs

2009-04-01 Thread Claus Reinke
Perhaps the rumours refer to non-tagged "versions"? In conventional non-distributed version control systems, one might go back to the version on a specific date, while with darcs, that only makes sense wrt a specific repo (I think?). So you can unpull all patches after a date from your local rep

Re: [Haskell-cafe] Issue with IsFunction/Vspace in GHC 6.10.1

2009-04-02 Thread Claus Reinke
{-# LANGUAGE ScopedTypeVariables #-} without, the 'f's in the instance are independent. Claus - Original Message - From: "Jacques Carette" To: Sent: Thursday, April 02, 2009 10:15 PM Subject: [Haskell-cafe] Issue with IsFunction/Vspace in GHC 6.10.1 I was playing with some of Oleg'

Re: [Haskell-cafe] Problem with prepose.lhs and ghc6.10.1

2009-04-03 Thread Claus Reinke
Hugs did not support lexically scoped type variables then (and probably doesn't support now). I may be misremembering, but I think Hugs had them first;-) http://cvs.haskell.org/Hugs/pages/hugsman/exts.html#sect7.3.3 It is just that Hugs and GHC interpret the language extension differently (as

Re: [Haskell-cafe] Wishful thinking: a text editor that expands function applications into function definitions

2009-04-03 Thread Claus Reinke
One word says more than a thousand pictures: Vim . (well, okay, I'm sure Emacs will do just as well, and some of the more recent IDEs seem to be catching up;-) plus plugins, of course!-) - unfolding definitions: if you really want that, it is in the domain of program tra

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

2009-04-04 Thread Claus Reinke
takeListSt' = evalState . foldr k (return []) . map (State . splitAt) where k m m'= cutNull $ do x<-m; xs<-m'; return (x:xs) cutNull m = do s<-get; if null s then return [] else m |Not only is ths not that elegant anymore, As I was saying, sequence/mapM with early cutout i

Re: [Haskell-cafe] high probability of installation problems andquality of the glorious implementation

2009-04-06 Thread Claus Reinke
I want the Zen package: "Make me one with everything." But would you find that on hackage?-) If an author had contemplated the perfect package, they wouldn't have put it on hackage, they wouldn't have a hackage account, they wouldn't have written the package, they might not even exist - you wou

Re: [Haskell-cafe] Making videos of your project

2009-04-06 Thread Claus Reinke
Btw, there seem to be many Haskells on YouTube - should we have some way of marking clips related to our Haskell? I've used haskell.org as a tag, but noone else has, yet - also, perhaps there should be a Haskell channel or something? And just in case there are others on the same Windows adventu

[Haskell-cafe] community.haskell.org unreachable?

2009-04-06 Thread Claus Reinke
I seem to be having problems reaching anything on that server. Does anyone know what is going on, or who to contact? It would help if the haskellwiki page http://www.haskell.org/haskellwiki/Haskell.org_domain would mention the admin address directly, instead of referring to http://community.has

Re: [Haskell-cafe] community.haskell.org unreachable?

2009-04-06 Thread Claus Reinke
f the connection. If I read the bandwith graph correctly, there was a peak followed by several hours of silence, matched by odd memory usage (though I don't see what the load average is trying to tell us?): http://community.haskell.org/mrtg/daily.html Claus On Mon, Apr 6, 2009 at 1:32 PM, Cl

Re: [Haskell-cafe] automatically inserting type declarations

2009-04-07 Thread Claus Reinke
I remember hearing about a Haskell mode for Vim, Emacs, Yi or VisualHaskell that inserts type declarations automatically (it's lazier to just check the type than to write it manually), but I can't remember any details. What editor mode / IDE was it? As far as I know, my haskellmode plugins for V

[Haskell-cafe] UPDATE: haskellmode for Vim now at projects.haskell.org (+screencast; -)

2009-04-07 Thread Claus Reinke
I have become aware that many Haskellers are not aware of the Haskell mode plugins for Vim, in spite of the >100 downloads per month I saw when I last checked. Since the plugins have just completed their move to their new home at http://projects.haskell.org/haskellmode-vim/ this seems to be a go

Re: [Haskell-cafe] UPDATE: haskellmode for Vim now atprojects.haskell.org (+screencast; -)

2009-04-07 Thread Claus Reinke
http://projects.haskell.org/haskellmode-vim/ The download link on this page seems to use \ instead of /, making it not work. For anyone eager to download it, just replace \ (or %5C) in your address bar with \ and it should work. argh, thanks, now fixed (filename completion in Vim, :help i_CT

Re: [Haskell-cafe] UPDATE: haskellmode for Vim now atprojects.haskell.org (+screencast; -)

2009-04-07 Thread Claus Reinke
Hi Matthijs, I've installed the vimball, and it spit a few errors at me. In particular, it couldn't find the haddock documentation directory. A quick look at haskell_doc.vim shows that it should autodetect the directory. However, for some reason my ghc-pkg command returns the doc directory twice

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-07 Thread Claus Reinke
Basically, type checking proceeds in one of two modes: inferring or checking. The former is when there is no signature is given; the latter, if there is a user-supplied signature. GHC can infer ambiguous signatures, but it cannot check them. This is of course very confusing and we need t

Re: [Haskell-cafe] UPDATE: haskellmode for Vim now atprojects.haskell.org (+screencast; -)

2009-04-07 Thread Claus Reinke
Matthijs, thanks for the reports, and analyses and suggested patches are even better! We should probably take this offlist at some point, though. I've found two more little bugs. The first is that version comparison is incorrect. It now requires that all components are greater, so comparing 6.1

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-07 Thread Claus Reinke
| Here is a variation to make this point clearer: | | {-# LANGUAGE NoMonomorphismRestriction #-} | {-# LANGUAGE TypeFamilies, ScopedTypeVariables #-} | | class Fun d where | type Memo d :: * -> * | abst :: (d -> a) -> Memo d a | appl :: Memo d a -> (d -> a) | | f = abst . appl | | -- f

Re: [Haskell-cafe] A challenge

2009-04-08 Thread Claus Reinke
|iterateM 0 _ _ = return [] |iterateM n f i = (i:) <$> (iterateM (n-1) f =<< f i) |iterateM' n f i = sequence . scanl (>>=) (return i) $ replicate n f These function are not the same (sequence of scanl? try using print in f). Also, I seriously hope you are not looking for this line noise:-) ite

Re: [Haskell-cafe] A challenge

2009-04-08 Thread Claus Reinke
|No indeed – that's what I meant about the latter being quadratic – it |runs the action far more times than the other. 'quadratic time' usually refers to complexity, not different results, so I thought I'd mention it anyway. |ghci tells me this: |Prelude Control.Applicative Control.Arrow> let it

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-09 Thread Claus Reinke
|Oh now i see what you mean: consider |f' = abst . (id :: (d->a)->(d->a)) . appl |which GHC understands to mean |f' = abst . (id :: forall d a. (d->a)->(d->a)) . appl | |GHC infers the type |f' :: (Fun d) => Memo d a -> Memo d a |Now you are saying that GHC *could* have fi

Re: [Haskell-cafe] compilation related questions

2009-04-10 Thread Claus Reinke
On a related note, I have another question. Say we have some data structure, for instance a list, some functions on this data structure (probably defined with some well known functions, such as map or fold), and a program using them. Is there any research trying to rewrite the program, and the dat

Re: [Haskell-cafe] Re: what does the hidden package error mean?

2009-04-11 Thread Claus Reinke
what a confusing error message, can we change it to say "package Foo is missing from the MyPackage.cabal build-depends" would be a lot more obvious how to fix it. The problem is that ghc doesn't know that, and shouldn't[1]: All it sees is a -hide-all-packages on its command line, you can witness

[Haskell-cafe] Non-atomic "atoms" for type-level programming

2009-04-14 Thread Claus Reinke
The recent GHC trac ticket revision reminded me of the old open type-sharing problem with type tags and record labels: - if type-level tags (such as 'data TTrue'/'data TFalse') are declared repeatedly in separate modules, they represent separate types, preventing shared use (your type-level

Re: [Haskell-cafe] Non-atomic "atoms" for type-level programming

2009-04-15 Thread Claus Reinke
- if type-level tags (such as 'data TTrue'/'data TFalse') are declared repeatedly in separate modules, they represent separate types, preventing shared use (your type-level predicate doesn't return my version of 'TTrue'/'TFalse') How is the need for a common import for 'data TTrue; data

Re: [Haskell-cafe] ANN: Elerea, another FRP library

2009-04-15 Thread Claus Reinke
but the fact that the breakout example works is an indication that at least it's not hopelessly broken. Well, a breakout game does *not* work (yet) in most other FRP implementations except Yampa, which do have firm theoretical foundations :-) While certainly more entertaining, the problem looks

Re: [Haskell-cafe] Strange type error with associated type synonyms

2009-04-16 Thread Claus Reinke
| But the core part of my suggestion (which this example was meant | to help explain) remains attractive, at least to me: somewhere during | type inference, GHC *does* unify the *apparently free* 'd' with an | internal type variable (lets call it 'd1, as in the type error message) You are specula

Re: [Haskell-cafe] ANNOUNCE: Utrecht Haskell Compiler (UHC) --first release

2009-04-19 Thread Claus Reinke
|data Test = Test { foo :: Int, bar :: Char, baz :: Bool } |smallPrint t = concatMap (\f -> show $ f t) [foo, bar, baz] |In this code the list [foo, bar, baz] should have the type [exists a. Show a => Test -> a]. {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ExistentialQuantification #-} data EShow

Re: [Haskell-cafe] UPDATE: haskellmode for Vim now at projects.haskell.org (+screencast; -)

2009-04-21 Thread Claus Reinke
sing!). The plugins have a trac instance as well (I've just made the link more prominent on their home page). Claus On Tue, Apr 7, 2009 at 10:23 AM, Claus Reinke wrote: I have become aware that many Haskellers are not aware of the Haskell mode plugins for Vim, in sp

Re: [Haskell-cafe] UPDATE: haskellmode for Vim now at projects.haskell.org (+screencast; -)

2009-04-21 Thread Claus Reinke
|Yes, I found that one myself. My old ftplugin/haskell.vim used to |have autoindent set, but importing your haskell mode overwrote that |(slightly irritating behaviour if you ask me ;-). Putting my old |config into ftplugin/haskell_mine.vim restored the behaviour. Yes, one cannot have two "majo

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) --first release

2009-04-22 Thread Claus Reinke
Installing executable(s) in /home/david/.cabal/bin why the hell would cabal install binaries in a subdirectory of a hidden directory. Why not /home/david/bin or /home/david/local/bin ? Yes, this is clearly suboptimal but getting agreement on where to put it has not proved easy. There are users t

Re: [Haskell-cafe] Non-atomic "atoms" for type-level programming

2009-04-22 Thread Claus Reinke
thanks for your elaborations. I'm still not convinced that a common name (e.g. TT :. Tr :. Tu :. Te) is a better interface than a common import (e.g. TypeLevel.Bool.True). In both cases, the authors of all modules have to actively collaborate, either to define common names, or to define common

Re: [Haskell-cafe] Non-atomic "atoms" for type-level programming

2009-04-22 Thread Claus Reinke
in case anyone stumbles over my ad-hoc notations, that should have been: module A[type label] where x = undefined :: label module B[type label] where x = undefined :: label module C[type label] where import A[label] import B[label] ok = [A.x,B.x] assuming that: - 'module X[types]' means a

Re: [Haskell-cafe] Re: ANNOUNCE: Utrecht Haskell Compiler (UHC) --first release

2009-04-23 Thread Claus Reinke
Let's turn this around. You invest 4 months of your life coming out with your own experimental Haskell compiler designed to easily test new language features. Then a bunch of ungrateful wretches on Haskell Cafe demand that you stop distributing your compiler until you have full support for Hask

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

2009-04-23 Thread Claus Reinke
*Main> :t rollDie ~>> (rollDie ~>> rollDie) rollDie ~>> (rollDie ~>> rollDie) :: Seed -> (Int, Seed) This is a function. How exactly do you want ghci to show it? When you figure that out, feel free to make an instance of Show for it. Just because user programs can't show function internals (th

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

2009-04-23 Thread Claus Reinke
Well, than, what would you expect from this: let {f x = g x; g 0 = 0; g n = f (n-1)} in show f Well, not show, because any show instance for functions breaks r.t. But the interactive interpreter, if it is not subject to r.t., might show: let { f x = g x; g 0 = 0; g n = f (

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

2009-04-24 Thread Claus Reinke
As far as referential transparency is concerned, you'd need to keep your reference levels straight, which can seem confusing if you can only communicate via representations(*:-) That came out more confusing than it needs to be, so let me try that again, from scratch: Reduction systems take pro

Re: [Haskell-cafe] breaking too long lines

2009-04-25 Thread Claus Reinke
* with practically every modern IDE (say, Eclipse for Java), indentation is a non-issue. How so? In future IDEs, source code might just be a view on an internal representation, but we've have that kind of IDE in the past, and some users developed a definite dislike to tools that wouldn't let th

Re: [Haskell-cafe] Can subclass override its super-class' defaultimplementation of a function?

2009-04-27 Thread Claus Reinke
Basically, I have a bunch of instances that have a common functionality but I'd like to be able to group those instances and give each group a different default implementation of that functionality. It's so easy to do this in Java, for example, but I have no idea how to do it in Haskell. The above

Re: [Haskell-cafe] Non-atomic "atoms" for type-level programming

2009-04-28 Thread Claus Reinke
Standard ML's answer to that kind of issue is type sharing. Does type sharing help with making modules retroactively compatible? It would be as if one could write modules parameterised by types, instead of declaring them locally, and being able to share a type parameter over several imports:

Re: [Haskell-cafe] Non-atomic "atoms" for type-level programming

2009-04-29 Thread Claus Reinke
z :: client -> Label client z client = undefined ok :: (B.Label client ~ A.Label client) => client -> [A.Label client]. ok client = [ A.z client, B.z client] This technique relies on the explicit management of the identities of modules both at compile-time (type annotatio

Re: [Haskell-cafe] How to install HOpenGL to Windows?

2009-04-30 Thread Claus Reinke
The thing is, it doesn't really matter if autoconf macros work fine for every Unix ever invented. The Windows users simply cannot use packages with configure scripts. They complain about it a lot. We can call them foolish for not installing cygwin/mingw, but they will not do it and instead will si

Re: [Haskell-cafe] Google SoC: Space profiling reloaded

2009-04-30 Thread Claus Reinke
http://socghop.appspot.com/student_project/show/google/gsoc2009/haskell/t124022468245 There's less than a month left before I'm supposed to jump into coding, and I'd love to hear about any little idea you think would make this project even better! I created a project page with a rough draft of wh

Re: [Haskell-cafe] How to install HOpenGL to Windows?

2009-04-30 Thread Claus Reinke
If someone wants to use a unix shell on an unknown platform, they should at least check that one exists there or -even better- provide one, not just assume that there'll always be one (and then be surprised about getting complaints from "those windows users"). Same for autoconf, make & co. Yo

Re: [Haskell-cafe] Array Binary IO & molecular simulation

2009-05-01 Thread Claus Reinke
So I wonder of existing projects of such type, both Molecular dynamics and Monte Carlo methods. The fastest Haskell Monte Carlo code I've seen in action is Simon's port of a Monte Carlo Go engine: http://www.haskell.org/pipermail/haskell-cafe/2009-March/057982.html http://www.haskell.org/pipe

Re: [Haskell-cafe] Combining computations

2009-05-03 Thread Claus Reinke
mplus' :: MonadPlus m => Maybe a -> m a -> m a mplus' m l = maybeToMonad m `mplus` l maybeToMonad :: Monad m => Maybe a -> m a maybeToMonad = maybe (fail "Nothing") return In general, however, this operation can't be done. For example, how would you write: mplus' :: IO a -> [a] -> [a] P

Re: [Haskell-cafe] Data.Map and strictness (was: Is Haskell aGoodChoice for WebApplications?(ANN: Vocabulink))

2009-05-07 Thread Claus Reinke
seq something like size map that will force a traversal of the entire tree, and ensure that the result is actually demanded, .. (Not tested) and not recommended, either, I'm afraid!-) |> Actually, I'm unsure how to fix this. For an expression like this: |> |>Data.Map.delete key map |> |>

Re: [Haskell-cafe] Re: Visualizing Typed Functions

2009-05-07 Thread Claus Reinke
With these functions visualized, one could make a kind of "drag and drop" interface for Haskell programming, although that isn't really my intention. I admit this is a little convoluted even for the purpose of visualization, but at least it's a starting place. Does anyone know of another syst

Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread Claus Reinke
I assume you want to write FRP in a Haskell-embedded DSL and generate FRP'd JavaScript. If you wish to use Flapjax as a supporting library I'd be glad to help. I'm curious: how difficult is it nowadays for in-page JavaScript to control the evolution of its surrouding page, FRP-style? I used to

Re: [Haskell-cafe] Functional Reactive Web Application Framework?

2009-05-13 Thread Claus Reinke
oops, sorry, keyboard accident >I assume you want to write FRP in a Haskell-embedded DSL and generate FRP'd JavaScript. If you wish to use Flapjax as a supporting library I'd be glad to help. I'm curious: how difficult is it nowadays for in-page JavaScript to control the evolution of its sur

Re: [Haskell-cafe] conflicting variable definitions in pattern

2009-05-15 Thread Claus Reinke
I miss lots of stuff from when I was a kid. I used to write elem x (_ ++ x : _) = True elem _ _ = False and think that was cool. How dumb was I? Yeah, the Kiel Reduction Language had similarly expressive and fun pattern matching, with subsequence matching and backtracking if

Re: [Haskell-cafe] tips on using monads

2009-05-18 Thread Claus Reinke
I've got one of those algorithms which "threatens to march off the right edge" (in the words of Goerzen et al). I need something like a State or Maybe monad, but this is inside the IO monad. So I presume I need StateT or MaybeT. However, I'm still (slowly) learning about monads from first princi

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Claus Reinke
My current best try uses the uvector package, has two 'vectors' of type (UArr Double) as input, and relies on the sumU and zipWithU functions which use streaming to compute the result: dist_fast :: UArr Double -> UArr Double -> Double dist_fast p1 p2 = sumDs `seq` sqrt sumDs where

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Claus Reinke
dist_fast :: UArr Double -> UArr Double -> Double dist_fast p1 p2 = sumDs `seq` sqrt sumDs where sumDs = sumU ds ds= zipWithU euclidean p1 p2 euclidean x y = d*d where

Re: [Haskell-cafe] tips on using monads

2009-05-18 Thread Claus Reinke
I've got one of those algorithms which "threatens to march off the right edge" (in the words of Goerzen et al). I need something like a State or Maybe monad, but this is inside the IO monad. So I presume I need StateT or MaybeT. However, I'm still (sdlowly) learning about monads from first princ

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Claus Reinke
Once I actually add a 'dist_fast_inline_caller', that indirection disappears in the inlined code, just as it does for dist_fast itself. dist_fast_inlined_caller :: UArr Double -> UArr Double -> Bool dist_fast_inlined_caller p1 p2 = dist_fast_inlined p1 p2 > 2 However, in the simpl output

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-18 Thread Claus Reinke
As I said, I don't get the fusion if I just add the function above to the original Dist.hs, export it and compile the module with '-c -O2 -ddump-simpl': I can't reproduce this. Interesting. I'm using ghc 6.11.20090320 (windows), uvector-0.1.0.3. I attach the modified Dist.hs and its simpl ou

Re: [Haskell-cafe] fast Eucl. dist. - Haskell vs C

2009-05-19 Thread Claus Reinke
I understand from your later post that is was in fact specialized, but how do I make sure it _is_ specialized? -ddump-tc seems to give the generalized type, so it seems you'd need to look at the -ddump-simpl output if you want to know whether a local function is specialized. http://www.haskell

Re: [Haskell-cafe] How to implement this? A case for scoped record labels?

2009-05-26 Thread Claus Reinke
I wonder if I am completely off here, but I am surprised that there is no progress on the scoped labels front. The Haskell wiki mentioned that the status quo is due to a missing optimum in the design space, but the same can be said about generic programming in Haskell and yet, GHC ships with Scrap

Re: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-28 Thread Claus Reinke
One user's view of error message history, perhaps helpful to reformers:-) Once upon a time, Hugs tended to have "better" error messages than GHC. They still weren't perfect, mostly when begginners where confronted with messages referring to advanced concepts - eg, Simon Thompson had a list of t

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-28 Thread Claus Reinke
Of course once you've got ifthenelse you find yourself wanting explicit desugaring of pattern matching (could view patterns help here?), Could you be more specific about what you want there, perhaps with a small example? I recognize the other problems from my own forays into EDSLs, but I'm not s

  1   2   3   4   5   6   >