Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-02 Thread Matthias Görgens
A better test might be if they really understood Applicative and Traversable, or if they knew how to use hsc2hs; Talk about unboxing and when to apply strictness annotations, finger trees, stream fusion, purely functional data structures or ways to implement memoization in a purely functional

Re: [Haskell-cafe] GHCi and State

2010-07-02 Thread Matthias Görgens
Hi Corentin, Interesting. Have you thought about following the example of XMonad instead? The analogy could goes as follows: XMonad's configuration file (~/.xmonad/xmonad.hs) = Your rules. XMonad's state = Your state. Editing the config file = Changing the rules. Of course you normally edit

Re: [Haskell-cafe] Strange typing?

2010-03-19 Thread Matthias Görgens
Hi Ozgur, Perhaps you can have a look at what discussion there was about non-empty lists. Seems (slightly) related to me. Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Why does `flip` cause function type so different ?

2010-03-19 Thread Matthias Görgens
Every question is welcome on  haskell-cafe . The goal of haskell-beginners  is to encourage answers that are tailored to beginners, i.e. no scary existential multi-parameter category theory type class monads there. :) Do you get warm fuzzy existential multi-parameter category theory type

Re: [Haskell-cafe] STM Skip list implementation

2010-03-17 Thread Matthias Görgens
Hi Peter, Interesting. Your skip lists do not need re-balancing, but they do destructive updates. I wonder which factor outweighs the other in practise. Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Hackaton: A roof to stay

2010-03-12 Thread Matthias Görgens
im planing on going to the hackaton, but the prices in Zurich are unusually high for my tight budget, so i was wondering if there is anyone here that lives there and would allow me to sleep on their couch or on the floor during the hackaton. Is there ? Just a suggestion: Have you tried one

Re: [Haskell-cafe] Haskell course, training

2010-03-10 Thread Matthias Görgens
I think I've reached the point where I need some tutoring, so provided I've got money for travel and course fees, and time, where do I get it? I'm not a student so some courses aren't available to me. How about visiting our Haskell meeting in Leipzig, June 4th? Which I can only recommend!

Re: [Haskell-cafe] Books for advanced Haskell

2010-03-04 Thread Matthias Görgens
A shining example are Dan Piponis blog posts. Not his fault, mind. All I see is that there is something powerful. I also notice that the big brains construct monads in many different ways and thus giving them entirely different capabilities. An example of this is some techniques turn CBV to

Re: [Haskell-cafe] A small oversight

2010-02-20 Thread Matthias Görgens
Also, constructions like  sortBy (compare `on` foo) must surely be very common. Just as a data point: I use constructions like the above very often. (Perhaps someone more enlightened than me can point out the connection to arrows?) Data.Function.on is surprisingly useful in some other

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-18 Thread Matthias Görgens
The trick is to use only non-negative variables for the equations. (That's considered OK in linear programming. Though you may consider it cheating.) By the way, linear programming over rational numbers is in P. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-18 Thread Matthias Görgens
But, isn't it the case that you can transform any linear inequality into a linear equality and a slack (or excess) variable? That's actually what you *need to do* to turn the problem into the canonical form, so that simplex can handle it. Yes. The simplex is usually implemented in this form.

Re: [Haskell-cafe] Linear programming in Haskell

2010-02-17 Thread Matthias Görgens
As far as I can see, you'd use that for systems of linear equalities, but for systems of linear inequalities with a linear objective function, it's not suitable. I may be wrong though :) There's a linear [1] reduction from one problem to the other and vice versa. [1] The transformation itself

Re: [Haskell-cafe] Re: How many Haskell Engineer I/II/IIIs are there?

2010-02-12 Thread Matthias Görgens
It might be big for SoC but perhaps there's some well-defined subset, like fix some blocking issue? Good idea. By the way, do all SoC projects have to be single-contributor projects, or could someone get together with a friend and work together on a somewhat larger project?

Re: [Haskell-cafe] If monads are single/linearly threaded, doesn't that reduce parallelism?

2010-02-11 Thread Matthias Görgens
Perhaps if you search for Abelian Monad or so, you will find interesting things in the category theory literature. Some of them may be transplantable to Haskell --- but you probably don't want a completely commutative structure. Arrows seem to express the dependencies between operations more

Re: [Haskell-cafe] Re: How many Haskell Engineer I/II/IIIs are there?

2010-02-11 Thread Matthias Görgens
Implementing an alternative RTS for GHC seems like a viable Google Summer of Code project to me. What do you think? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Matthias Görgens
I used Haskell for some Research Development work at Deutsche Bahn, earlier. (But my program was not integrated with their other systems.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How many Haskell Engineer I/II/IIIs are there?

2010-02-10 Thread Matthias Görgens
I think this has a lot to do with the fact that  web programming is very much a let's go shopping kind of  discipline -- no point in troubling oneself over correctness  when the users haven't weighed in on the worth of your site.  Of course this attitude leads to a long maintenance phase of

Re: [Haskell-cafe] If monads are single/linearly threaded, doesn't that reduce parallelism?

2010-02-09 Thread Matthias Görgens
Monads are not commutative. A structure that would tell the compiler that it's commutative, would give it more leeway for optimization (and parallel execution). ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Navigating Graphs

2010-02-09 Thread Matthias Görgens
Using something like zippers it is easy to navigate an acyclic graph in O(1) operations per arc you follow. Inspired by Chris Okasaki's work on queues I wondered if there is a similar approach to navigating cyclic graphs. If the graph you are navigating is static (i.e. does not have to support

Re: [Haskell-cafe] OT: Literature on translation of lambda calculus to combinators

2010-02-01 Thread Matthias Görgens
Dear Dušan, You can also find an algorithm in everyone's favourite book in combinatorial logic To Mock a Mockingbird (http://en.wikipedia.org/wiki/To_Mock_a_Mockingbird). Cheers, Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Job opportunities at Citrix Systems (Cambridge, UK)

2010-01-26 Thread Matthias Görgens
Hi folks, I have recently started working for Citrix in Cambridge. We are working on the open source software in Ocaml. Admittedly Ocaml is only a second best compared to Haskell ;o) and I hope my post does not count as too off-topic here. But Ocaml is still a decent language. My experience

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Matthias Görgens
Hi, it may be a bit too late for you, but in general working through Smullyan's To Mock a Mockingbird (http://en.wikipedia.org/wiki/To_Mock_a_Mockingbird) may help in coming to grips with some of the theory (and intuition) behind functional programming. The Real World Haskell book is also a good

Re: [Haskell-cafe] Language simplicity

2010-01-14 Thread Matthias Görgens
All Lisps have special forms which are evaluated uniquely and differently from function application and are therefore reserved words by another name. For example, Clojure has def, if, do, let, var, quote, fn, loop, recur, throw, try, monitor-enter, monitor-exit, dot, new and set!. Yes, but

Re: [Haskell-cafe] Typed Configuration Files

2010-01-14 Thread Matthias Görgens
Hi Sebastian, You might also want to look at how xmonad handles it's configuration. Basically the configuration file is the main-file that produces the executable and takes in the rest of xmonad as a library. This works out quite well, but you need a compiler to update the configuration.

Re: [Haskell-cafe] Haskell for Physicists

2009-12-04 Thread Matthias Görgens
 _So my strong opinion that solution is only DSL not EDSL_ Why do you think they will learn your DSL, if they don't learn any other language? And if your DSL includes general purpose stuff, like functions, control structures, data structures, you'll re-invent the wheel. Probably porly.

Re: [Haskell-cafe] Card games

2009-12-03 Thread Matthias Görgens
Hi Tom, Did you make any progress on your Dominion quest? I guess you could start by modeling `Big Money' and add the other cards (and interaction) from there. Also I guess there is a common baseline of things that are inherent in a lot of card games --- mechanics that cards support: Shuffling,

Re: [Haskell-cafe] I miss OO

2009-12-03 Thread Matthias Görgens
It would be fantastic to have a little practical real-world challenge (like building a simple music system, or a simple multi-channel sound mixer), and work this out in an imperative language, an object-oriented language, a functional language, and maybe other languages too, like logic

Re: [Haskell-cafe] I miss OO

2009-12-03 Thread Matthias Görgens
When OO is about constructing a machine and talking about objects, and FP is about making little algebraic languages, what would C or Pascal be like? In these languages, you don't think about objects, but you don't think about an algebra either? It's been a very long time since I worked with

[Haskell-cafe] Ord k = Data.Set.Set k - (k-v) - Data.Map.Map k v

2009-12-02 Thread Matthias Görgens
I feel that Data.Set and Data.Map should be working together more closely. For example you can already get the keyset of a Map, but the `other way' is not built-in. I mean a function with a signature like Ord k = Data.Set.Set k - (k-v) - Data.Map.Map k v You can implement it in O(n): assoc

Re: [Haskell-cafe] Card games

2009-11-07 Thread Matthias Görgens
Hi Felipe, Interesting idea. But I guess you should clarify what kind of card games you want to support. E.g, a DSL for trick taking games like Bridge, Skat or Doppelkopf might be different from one that's good for Canasta or Rummy. Or do you aim at Solitaire? I'd suggest starting with a very

Re: [Haskell-cafe] Re: Simple quirk in behavior of `mod`

2009-07-23 Thread Matthias Görgens
Round-to-even means x.5 gets rounded to x if x is even and x+1 if x is odd. This is sometimes known as banker's rounding. OK. That's slightly unusual indeed. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Generalizing takeWhile

2009-07-22 Thread Matthias Görgens
I need to take some elements from the front of a list.  However the criteria are somewhat complex. walk f [] = [] walk f (x:xs) = case f x of Just g - x : walk g xs Nothing - [] For each item the `predicate' f either returns Nothing, when it thinks we

Re: [Haskell-cafe] Generalizing takeWhile

2009-07-22 Thread Matthias Görgens
Thanks to Jason and Felipe. I'll try that approach. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Generalizing takeWhile

2009-07-22 Thread Matthias Görgens
What is the use case(s) for this function? I often want to take one more element than takeWhile does, or only start checking the predicate after taking the first element for sure. Or both. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Simple quirk in behavior of `mod`

2009-07-22 Thread Matthias Görgens
Couldn't the same be said for round-to-even, instead of rounding down like every other language? I doubt any beginners have ever expected it, but it's probably better. What do you mean with round-to-even? For rounding down there's floor. ___

Re: [Haskell-cafe] can there be (hash-table using) O(n) version of this (I think currently) n log n algo?

2009-07-18 Thread Matthias Görgens
However you can use the wider idea of hashing: A nesting of two finite maps. One fast, but approximative map. And one slow, but exact map. The quintessential example is an array indexed with some hash function for the first map. And linked lists of (key,value) pairs as the latter. In Haskell

Re: [Haskell-cafe] Python vs Haskell in tying the knot

2009-07-17 Thread Matthias Görgens
BTW, after a -O2 compilation, fib' is apparently as fast a fib. The compiler is your friend. :o) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Jane Street

2009-07-17 Thread Matthias Görgens
If one of you knows something about working at Jane Street, I'd be happy to have exchange some mails. I am considering applying there. Thanks! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] laziness blowup exercise

2009-07-17 Thread Matthias Görgens
Thomas, if you did no know, where to look for `lazy-memory-hole', say in your first example, how would you go about solving that puzzle systematically with a Profiler (or other tools)? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] laziness blowup exercise

2009-07-17 Thread Matthias Görgens
I tried using your original code and stuffing it into a profiler. But all I get is a triangle of linearly increasing resource usage, and then it breaks for lack of stack. I guess I am just to ignorant about retainer profiling and such stuff. ___

Re: [Haskell-cafe] Plot data reconstruction reading pixel colors from image files

2009-07-17 Thread Matthias Görgens
If you don't find anything more specific, I suggest taking a look at Data.Binary and reading a simple format like BMP or so. (You can convert your file to BMP with an external program before.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-16 Thread Matthias Görgens
By the way, does Hat - the Haskell Tracer? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Debugging methods for haskell

2009-07-16 Thread Matthias Görgens
By the way, does Hat - the Haskell Tracer? Please append: still work. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Haskell Zippers on Wikibooks: teasing! :)

2009-07-15 Thread Matthias Görgens
doesn't make much sense to me yet, although I suspect I can read the mu as a lambda on types? Not really. The mu has more to do with recursion. Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: Re[2]: [Haskell-cafe] What to say about Haskell?

2009-07-14 Thread Matthias Görgens
Dear Gergely, Okasaki's Purely Functional Data Structures is a treasure trove of interesting things to demonstrate Haskell on. Especially the data structures based on numerical representations (skew binary numbers and so on) appealed to my mathematical side. Matthias.

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

2009-07-14 Thread Matthias Görgens
It maybe be that Haskell is harder to learn as your *second* language because you have to unlearn things. Especially if your first language was something like C or Python. Python is not too bad. You can nearly use it a as a strict functional programming language. While this is not the

Re: [Haskell-cafe] haskell.org: what can be improved causing what efforts?

2009-07-13 Thread Matthias Görgens
code snippet: no hello world please. That's not a way to judge a language! But: a random haskell one line snippet with explanation would be cool. Perhaps a solution to a problem like the ones you can find on Project Euler (http://projecteuler.net/index.php?section=problems). Of course you

Re: [Haskell-cafe] haskell.org: what can be improved causing what efforts?

2009-07-13 Thread Matthias Görgens
I like the quicksort example at http://www.haskell.org/haskellwiki/Introduction very much; it shows how much time you can save when you use Haskell. Nice idea. Perhaps use a merge sort, because that is actually useful, because it does not degenerate for large lists. Matthias.

Re: Re[2]: [Haskell-cafe] haskell.org: what can be improved causing what efforts?

2009-07-13 Thread Matthias Görgens
Nice idea.  Perhaps use a merge sort, because that is actually useful, because it does not degenerate for large lists. Great idea if we want to keep Haskell community compact :))) Or stay with quicksort --- which is treesort. :o) ___ Haskell-Cafe

Re: [Haskell-cafe] Re: excercise - a completely lazy sorting algorithm

2009-07-09 Thread Matthias Görgens
Interesting. Can you make the definition of quicksort non-recursive, too? Perhaps with help of a bootstrapping combinator like the one implicit in the approach I have given earlier? treeSort = bootstrap partitionOnMedian bootstrap f = Fix . helper . f where helper = fmap (Fix . helper .

Re: [Haskell-cafe] Re: excercise - a completely lazy sorting algorithm

2009-07-09 Thread Matthias Görgens
Thanks. I heard about the hylo-, ana- and catamorphisms before, but never explicitly used them. Time to get started. And yet another question: One can get the median in deterministic linear time. For quicksort choosing the median as pivot keeps the O(n log n) average running time and brings

Re: [Haskell-cafe] Re: Haskell Platform on Ubuntu

2009-07-08 Thread Matthias Görgens
One problem I see is the binary-only distribution of packages. This makes cabal-install incompatible with most distributions except, maybe, gentoo. The automation process would have to run through hackageDB tracking dependencies and compiling each needed library. Pretty hard stuff... Yes.

Re: [Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-07 Thread Matthias Görgens
Dear Hector, Yes, I thought of a similar scheme. Say we want to implemented randomized quicksort. Passing a list of random numbers would destroy laziness and linearise the algorithm --- because the right recursion branch would need to know at least how many random numbers where consumed by the

Re: [Haskell-cafe] Re: excercise - a completely lazy sorting algorithm

2009-07-07 Thread Matthias Görgens
So, a tree like Matthias implements it is the way to go. Basically, it reifies the recursive calls of quicksort as a lazy data struture which can be evaluated piecemeal. Yes. I wonder if it is possible to use a standard (randomized quicksort) and employ some type class magic (like

Re: [Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-07 Thread Matthias Görgens
What I wondered was, if one could hid the random plumbing in some data structure, like the state monad, but less linear. This problem cries for a State monad solution - but you don't need to do it yourself, there's already a Random monad defined for you. Yes, but I only need the random

Re: [Haskell-cafe] Re: Haskell Platform on Ubuntu

2009-07-07 Thread Matthias Görgens
Karmic (9.10) will have GHC 6.10.3, possibly 6.10.4. It currently spots 6.10.3, in the alpha release I run here. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Optimizing Compiler for the ICFP 09 contest's VM

2009-07-07 Thread Matthias Görgens
Since I have two readers now, I guess I'll have to start blogging. :o) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] simple state monad exercises? (besides labeling trees)

2009-07-06 Thread Matthias Görgens
Can someone give some simple common scenarios where the state monad is useful, besides labeling trees? Emulating the VM given in this years ICFP programming contest was also a good application of the state monad. Of course you interprate much simpler language imperative languages, too.

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Matthias Görgens
Interesting problem. I have been toying with the same problem for some time. To solve the problem in theory, I'd concentrate on getting the number of comparisons into the required O(n) resp. O(n log n) ranges. Afterwards we can think about building the infrastructure to keep the number of all

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Matthias Görgens
If someone can translate my algorithm into a non-side-effecting one, I'd appreciate it, but I think that like disjoint set/union, this is probably inherently side-effecting.  Yes, yes, we could use functional arrays, but short of that I don't see a way to avoid side effects to take care of my

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Matthias Görgens
It seems to me, that you just need a selection algorithm which works in O(n * k) time for k arbitrary elements. If you combine O(n*k) selection algorithm with any O(n * lg n) sort, you furfil your time constrain. I guess, we also want the list to be sorted in O(1) after having selected every

Re: [Haskell-cafe] excercise - a completely lazy sorting algorithm

2009-07-06 Thread Matthias Görgens
The sorted array of bags of unsorted input is a nice idea. However, you have to use the data structure in a single-threaded [1] fashion to obtain the claimed bounds. Here's a pure solution that uses amortization and laziness. import qualified Data.Sequence as S import Data.Sequence (())

[Haskell-cafe] Implementing Las Vegas algorithms in Haskell

2009-07-06 Thread Matthias Görgens
A Las Vegas algorithm, like randomized quicksort, uses a source of randomness to make certain decisions. However its output is unaffected by the randomness. So a function f :: RandomGen g = g - a - b implementing a Las-Vegas-Algorithm 'looks' like a pure function, ignoring its first argument

Re: [Haskell-cafe] Cont, ContT and IO()

2009-07-04 Thread Matthias Görgens
process [] = return () process (file:files) = do x - doit file                          if x0 then process files                                 else return () Or use a fold: process' = foldl op True files op True file = doit file op False _ = False

Re: [Haskell-cafe] Cont, ContT and IO()

2009-07-04 Thread Matthias Görgens
process' = foldl op True files op True file = doit file op False _ = False Please pardon me. 'doit' should surely be able to do some IO: import Data.Foldable import System.IO process' = foldlM op True files op True file = doit file op False _ = return False were DoIt has the type

Re: [Haskell-cafe] Re: Cont, ContT and IO() - Code on hpaste

2009-07-04 Thread Matthias Görgens
Hi Günther, here is a solution with the Maybe Monad: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=6515#a6515 Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Cont, ContT and IO() - Code on hpaste

2009-07-04 Thread Matthias Görgens
P.S. See http://en.wikibooks.org/wiki/Haskell/Monad_transformers for some documentation. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Cont, ContT and IO() - Code on hpaste

2009-07-04 Thread Matthias Görgens
P.P.S. Strange it does not seem to work with the paste. So here comes the solution by mail: module Consolidator.BusinessLogic.ConflictsResolved (consolidateDuplicates) where import System.FilePath import System.Directory import Control.Monad (filterM) import Control.Exception (throwIO) import

[Haskell-cafe] Optimizing Compiler for the ICFP 09 contest's VM

2009-07-04 Thread Matthias Görgens
The byte code for the virtual machine of this years ICFP specified a language with single assignment per simulation step. Interestingly most memory locations get overwritten each simulation step before they are read. That means, those locations don't have to be remember between steps. Also

Re: [Haskell-cafe] List spine traversal

2009-07-01 Thread Matthias Görgens
As a side note, (allowing seq and unsafePerformIO if necessary) is it possible to implement a map that preserves cycles (instead of transparently replacing them with infinite copies?  Not horribly useful, but would be quite cute. Baltasar Trancon y Widemann gave a talk on a generalized

Re: [Haskell-cafe] List spine traversal

2009-07-01 Thread Matthias Görgens
you will find it there but it's written in German. Yes. But at least there's an English abstract. Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] combining monads with IO

2009-06-25 Thread Matthias Görgens
By the way, how would one write the following with Monad Transformers? newtype IOMayfail a = IOMayfail (IO (Maybe a)) instance Monad IOMayfail where return = IOMayfail . return . return (=) a f = IOMayfail (bind (run a) (run . f)) fail s = trace s (IOMayfail $ return Nothing)

Re: [Haskell-cafe] combining monads with IO

2009-06-25 Thread Matthias Görgens
Thanks. Can I add something like fail? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Another question about unsafePerformIO

2009-06-25 Thread Matthias Görgens
I have a program that optimizes train schedules. It employs an external solver for Integer Linear Programs. The solve function has the following type: solve :: Constraints - IO (Maybe Solution) And this works. However, my external solver also behaves like a pure function from input to

Re: [Haskell-cafe] Another question about unsafePerformIO

2009-06-25 Thread Matthias Görgens
Adding 'unsafePerformIO' will work, but a better idea might be to understand why your solver has IO in its type signature. Is this because of FFI calls? You can remove IO in FFI calls if they are free from side effects as well. My solver has IO in the type signature, because I said so. :o)

Re: [Haskell-cafe] slow code

2009-06-17 Thread Matthias Görgens
Still, a fast and general way to output primitive data types would be quite welcome. Naive question: Can't we just ask C to do it for us? (With a foreign function call.) Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Purely logical programming language

2009-05-27 Thread Matthias Görgens
Mercury also has type classes and other Haskellisms, so if you're interested in doing Prolog the Haskell way, you should definitely have a look at it. I have to admit that I am not very familiar with Mercury. But if you are looking for doing Prolog the Haskell way advertiseyou can also have

[Haskell-cafe] Purely logical programming language

2009-05-26 Thread Matthias Görgens
There are a number of ways to marry purely functional programming languages with IO. To name just two possibilities: Clean uses linear types, threading exactly one World through functions, Haskell uses Monads. The model in Prolog, however, looks more like the model used in most strict functional

Re: [Haskell-cafe] Purely logical programming language

2009-05-26 Thread Matthias Görgens
Mercury also has type classes and other Haskellisms, so if you're interested in doing Prolog the Haskell way, you should definitely have a look at it. Thanks. I'll have a look. (I also just found Mercury on my own: After I posed my original question, I tried another web search, and found

[Haskell-cafe] ICFP Participation

2009-05-23 Thread Matthias Görgens
Hello, Please pardon my naive question: Is there a way to sign on for ICFP 09? The homepage (http://www.cs.nott.ac.uk/~gmh/icfp09.html) only seems to mention how to submit papers. Is there a way to attend as a mere participant? Thanks, Matthias. ___

Re: [Haskell-cafe] ICFP Participation

2009-05-23 Thread Matthias Görgens
Registration will be open soon. Thanks. (I could have written an Experience Report about how I am using Haskell at Deutsche Bahn, but that deadlines had already passed.) Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] The Computer Language Benchmarks Game: pidigits

2009-05-23 Thread Matthias Görgens
Hi, By the way: Would it be considered good style to include QuickTest properties into the pidigit submission? Matthias. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Pretty printing a tree

2009-05-15 Thread Matthias Görgens
Hello, Or --- if you just want pretty trees and you are not confined to the command line: You can generate GraphViz code and use that program to draw your tree in PostScript. (There is also a GraphViz-package, but generating the code yourself is easy.) Matthias.