[Haskell-cafe] consulting and contracting

2009-12-11 Thread Tim Newsham
tools? Mostly related to academia? Spread out around several areas? Tim Newsham | www.thenewsh.com/~newsham | thenewsh.blogspot.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Pike's Newsqueak talk

2009-06-05 Thread Tim Newsham
Tim Newsham wrote in article in gmane.comp.lang.haskell.cafe: his language also supports an interesting imperative primitive that lets you pick the first available value from a set of channels which isn't available in pure Haskell expressions. Has anyone implemented a primitive like thi

[Haskell-cafe] Pike's Newsqueak talk

2009-06-05 Thread Tim Newsham
u pick the first available value from a set of channels which isn't available in pure Haskell expressions. Has anyone implemented a primitive like this for Haskell? Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing li

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

2009-03-24 Thread Tim Newsham
reuse. Manlio Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

2009-03-24 Thread Tim Newsham
viously if you are writing code that you want to be readable by people who arent well versed in common Haskell idioms, you'd limit your use of abstractions.] Manlio Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haske

Re: [Haskell-cafe] symbolic evaluator for Haskell?

2009-03-18 Thread Tim Newsham
e of GADTs. I'm thinking it might not be too hard to implement using TH, but haven't tried yet... (though not sure if TH supports GADTs). Live well, ~wren Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-C

[Haskell-cafe] symbolic evaluator for Haskell?

2009-03-17 Thread Tim Newsham
or (+) and (*). (Something that supports ghc extensions is preferred :) Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] binary serialization

2009-03-04 Thread Tim Newsham
that: Data.Derive can be used to automatically generate Data.Binary.Binary instances for your custom data types. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] monadic MapReduce

2009-03-03 Thread Tim Newsham
mappend the monoid values in whatever order it wants (by applying associativity). Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] nubBy changed?

2009-03-01 Thread Tim Newsham
Did nubBy change recently? In 6.8.2 I could generate primes as: nubBy (\a b -> b `mod` a == 0) [2..] but in 6.10.1 I have to use nubBy (\a b -> a `mod` b == 0) [2..] Is this change intentional? If so, what is the reason? Tim Newsham http://www.thenewsh.com/~n

Re: [Haskell-cafe] Formal semantics for Haskell?

2009-02-09 Thread Tim Newsham
ML has a formal definition[1]; why not Haskell? Would this be a Good Thing, or a Waste Of Time? Not exactly what you are asking for, but a start: http://www.cs.kent.ac.uk/pubs/1992/123/index.html gregg Tim Newsham http://www.thenewsh.com/~newsham

Re: [Haskell-cafe] Monad explanation

2009-02-06 Thread Tim Newsham
ler or interpretter arranges this for you as part of its contract with you. I hope I'm not making this worse! :-) I dont think so. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Monad explanation

2009-02-05 Thread Tim Newsham
an imperative programming language, but any imperative actions show up in the type.) I don't see the difference between these two interpretations. Wether the program is made up of instructions for a cpu or for an interpreter seems irrelevant.

[Haskell-cafe] Monad explanation

2009-02-04 Thread Tim Newsham
or an intuitive definition but may not yet have the background or the inclination to jump into full tutorial to tackle the subject. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/ma

Re: [Haskell-cafe] Verifying Haskell Programs

2009-02-03 Thread Tim Newsham
www.cs.kent.ac.uk/people/staff/sjt/TTFP/ Denis Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Haskell Web Framework

2009-01-26 Thread Tim Newsham
those that want it. From my Django experience, I must say that very few things are cooler than calling a script which automatically generates all the boilerplate code inherent in every web app. Cooler: abstracting away the boilerplate. Michael Tim Newsham http://www.thenewsh.com/~newsham

Re: [Haskell-cafe] Why monoids will abide...

2009-01-22 Thread Tim Newsham
lyzes the model of Google's MapReduce and Sawzall. quick haskell summaries at: http://www.thenewsh.com/~newsham/x/machine/MapReduce.hs http://www.thenewsh.com/~newsham/x/machine/Sawzall.hs The MapReduce model isn't based directly on a monoid, but the Sawzall model is. T

Re: [Haskell-cafe] ANN: HTTPbis / HTTP-4000.x package available

2009-01-17 Thread Tim Newsham
nted this for a while now. "Me Too." Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] software correctness ... can we in FPL step up to the plate??

2009-01-15 Thread Tim Newsham
of ways to write incorrect software despite the help these tools provide. These tools are very valuable and should be sold to the wider developer community, but they are no silver bullet. Vasili Tim Newsham http://www.thenewsh.com/~newsham/ ___ Ha

Re: [Haskell-cafe] Re: Monads aren't evil? I think they are.

2009-01-13 Thread Tim Newsham
, but I've actually found the Binary.Put.PutM (where Put = PutM ()) to be useful. Sometimes your putter does need to propogate a result... Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://

Re: [Haskell-cafe] Re: Haskell not ready for Foo [was: Re: Hypothetical Haskell job in New York]

2009-01-09 Thread Tim Newsham
ta directly from a byte stream to an Int type without caring about the underlying representation of your Int. Why do people want the htonl function? Bardur Arantsson Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haske

Re: [Haskell-cafe] Haskell not ready for Foo [was: Re: Hypothetical Haskell job in New York]

2009-01-08 Thread Tim Newsham
On Jan 8, 2009, at 12:56 PM, Tim Newsham wrote: You replied to someone discussing using Haskell at a CDN to implement things like web servers by saying that Haskell wasn't suitable for the task. That is incorrect. I replied to Achim's message asking for elaboration on Haskell'

Re: [Haskell-cafe] Haskell not ready for Foo [was: Re: Hypothetical Haskell job in New York]

2009-01-08 Thread Tim Newsham
ually need to do. It's the higher level stuff where there's a huge amount of room for improvement. You replied to someone discussing using Haskell at a CDN to implement things like web servers by saying that Haskell wasn't suitable for the task. John Tim Newsham http://

Re: [Haskell-cafe] Haskell not ready for Foo [was: Re: Hypothetical Haskell job in New York]

2009-01-08 Thread Tim Newsham
ices I might want to implement. John Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] data declarations should provide fold functions

2009-01-07 Thread Tim Newsham
ons to extract constituents in a points-free manner. I know the short-term answer is "use TH" to derive folds if I want them, but I think such an important concept should probably be part of the language. Tim Newsham http://www.thenewsh.com/~newsham/ _

Re: [Haskell-cafe] Coroutines

2008-12-18 Thread Tim Newsham
you similar control as coroutines, I wanted to point out how simple it is to implement coroutines. Here's a simple implementation that ddarius made on IRC a few months back off-the-cuff. I kept it around on codepad because its cool: http://codepad.org/GwtS6wMj -- ryan Tim Newsham

Re: [Haskell-cafe] Crash!

2008-10-24 Thread Tim Newsham
s claim is strong enough without embellishment. -- Don Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Crash!

2008-10-24 Thread Tim Newsham
is due to Gtk2hs (well-tested though it may be) or one of its underlying dependencies (such as libpng). Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] synchronous channels in STM

2008-10-09 Thread Tim Newsham
elease the sender as soon as the message is received, if that's what you wanted. Is this close enough for you, or does it have to be in STM? cheers, rog. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Hask

Re: [Haskell-cafe] TH code for deriving Binary and NFData instances

2008-09-27 Thread Tim Newsham
lots more). Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] TH code for deriving Binary and NFData instances

2008-09-27 Thread Tim Newsham
Here's some TH code for automatically deriving Data.Binary and Control.Parallel.Strategies.NFData instances: http://www.thenewsh.com/~newsham/store/DeriveBinary.hs Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Ha

[Haskell-cafe] TH error

2008-09-26 Thread Tim Newsham
[| getWord8 >>= \x -> $(caseE [| x |] gcases') |] and put x = $(caseE [| x |] (map return ps)) |] but I don't understand why these might be causing errors (if they are indeed the cause). Using -ddump-splices doesn't help since it seems to hit the error before

Re: [Haskell-cafe] haskell shootout -- mandelbrot

2008-09-21 Thread Tim Newsham
Here's a whack at regex-dna: http://haskell.org/haskellwiki/Shootout/Parallel/RegexDNA only modest speedup (memory bw bound?). A regex engine that could run several machines concurrently in one pass would prob be a big win. Tim Newsham http://www.thenewsh.com/~ne

Re: [Haskell-cafe] haskell shootout -- mandelbrot

2008-09-20 Thread Tim Newsham
a) have you submitted it to the shootout. no b) is it faster yes c) can you put it on the parallel shootout wiki, http://haskell.org/haskellwiki/Shootout/Parallel http://haskell.org/haskellwiki/Shootout/Parallel/Mandelbrot Tim Newsham http://www.thenewsh.com/~newsham

[Haskell-cafe] haskell shootout -- mandelbrot

2008-09-20 Thread Tim Newsham
more complicated changes so I didn't try that yet. Anyway, the code and the results are here. See README for details: http://www.thenewsh.com/~newsham/shootout/ Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Ha

Re: [Haskell-cafe] Re: Functional references

2008-09-06 Thread Tim Newsham
ss. In earlier versions I had a function for converting an invertible into an FRef. ~wren Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Functional references

2008-09-05 Thread Tim Newsham
ate monad you can import FRef.State and get the State definitions that dont interfere with the standard "get" and "modify" names. In the rare case (I think, am I wrong?) where you use both State and FRef "modify" and "get" definitions in the same file, you can

[Haskell-cafe] Functional references

2008-09-04 Thread Tim Newsham
cting words or replacing words in a string or values in an association list. I'm hoping it will provides a useful framework for editing complex values such as data embedded in Base64 cookies in an HTTP header. Tim Newsham http://www.thenewsh.co

Re: [Haskell-cafe] Haskell Propeganda

2008-08-28 Thread Tim Newsham
s. would you include all partial functions in this, such as head? brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED] Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskel

[Haskell-cafe] contributing to standard library

2008-08-26 Thread Tim Newsham
hat we can contribute to to "try out" for the big league? Here are some functions: http://www.thenewsh.com/%7Enewsham/x/machine/Missing.hs Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org ht

Re: [Haskell-cafe] Haskell Propeganda

2008-08-23 Thread Tim Newsham
ile having a theorem checker that helps programmers find and avoid bugs and while being based on semi-formal concepts that can be used to avoid some pitfalls, is still no silver bullet against any and all crashes. Promising would-be converts that it is will only lead to disappointmen

Re: [Haskell-cafe] Haskell Propeganda

2008-08-23 Thread Tim Newsham
urally (unfortunately). By the way, the Java camp has (correctly) been touting this argument for quite a while. Bob Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] FRP question

2008-08-17 Thread Tim Newsham
es? Pairs of (connection identifier,data)? How would such a system effectively hide the multiplexed IO going on? Is this sort of problem poorly suited for FRP? Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@h

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-14 Thread Tim Newsham
://www.thenewsh.com/%7Enewsham/store/test10.hs it seems to work, although it doesn't seem to be very efficient. I'm getting very large memory growth when I was hoping it would be lazy and memory efficient... What's leaking? -- Don Tim Newsham http://www.thenew

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-14 Thread Tim Newsham
hile. (This would be a fine point for the documentation to address to prevent others from falling in the same hole). I'm currently using definitions like these and (`using` rnf) and have a server that is able to repeatedly read and write the state file. Many thanks to Dons, Brian, Du

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-13 Thread Tim Newsham
you decode, just ask keep asking for bytes till EOF, or close it yourself, decodeFile f = do h <- openFile f ReadMode ss <- L.hGetContents h let e = decode ss rnf e `seq` hClose h or some such, where you can confirm the decoding as taken place. Tim Newsham http

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-13 Thread Tim Newsham
decodeFully = runGet (get << binEof) where a << b = a >>= (\x -> b >> return x) but even when using decodeFully, it still doesn't close the handle. Shouldn't Data.Binary.Get.isEmpty force a file handle close in the case that it returns True? Tim Newsham http://

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-13 Thread Tim Newsham
t after doing a "decode". If "decode" completes and there is unconsumed data, it should probably raise an error (it already raises errors for premature EOF). There's no reason for it not to, since it does not provide the unconsumed data to the calle

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-13 Thread Tim Newsham
d when the last byte is read (in this case its definitely reading all four bytes) or when the first byte after that is read (in this case it probably doesn't attempt to read more than 4 bytes)? Tim Newsham http://www.thenewsh.com/~newsham/ ___ H

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Tim Newsham
x" =<< B.readFile "test.hs" If you replace B.readFile with readFile and B.writeFile with writeFile it works properly. ByteString bug? Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Tim Newsham
ata entirely: d <- decode <$> B.readFile stateFile print d and I still get the same error when I go to writeFile later. There should be no data items in any of my structures that the print statement does not force. Tim Newsham http://www.thenewsh.com/~newsham/ _

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Tim Newsham
). I still get the same error condition. Felipe. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Tim Newsham
for the actual string. -- Don Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Tim Newsham
On Tue, 12 Aug 2008, Bryan O'Sullivan wrote: On Tue, Aug 12, 2008 at 5:34 PM, Tim Newsham <[EMAIL PROTECTED]> wrote: I tried to force the data with: loadState db = do d <- decode <$> B.readFile stateFile let force = sum $ M.elems $ M.size `fmap`

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Tim Newsham
.size `fmap` d force `seq` atomically $ writeTVar db d and I get the same error when trying to writeFile after doing a loadState. -- Don Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://w

Re: [Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Tim Newsham
in readFile. I will try forcing the data. -- Don Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] two problems with Data.Binary and Data.ByteString

2008-08-12 Thread Tim Newsham
n: openFile: resource busy (file is locked) this does not occur if the program wasnt loaded. My best guess here is that B.readFile isnt completing and closing the file for some reason. Is there a good way to force this? Tim Newsham http://www.thenewsh.com/~newsham/

Re: [Haskell-cafe] code review? store server, 220loc.

2008-08-05 Thread Tim Newsham
On Sat, Aug 2, 2008 at 10:13 PM, Tim Newsham <[EMAIL PROTECTED]> wrote: http://www.thenewsh.com/%7Enewsham/store/Server5.hs You should try profiling this. I can see a few possible problems (such as reading String from a socket, instead of a ByteString), but it's difficult to p

Re: [Haskell-cafe] code review? store server, 220loc.

2008-08-04 Thread Tim Newsham
responses are quite small). I'll write up some tests to see how well those perform.. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] code review? store server, 220loc.

2008-08-03 Thread Tim Newsham
verhead will be about the same size). Anyway, with such small sizes, the performance shouldn't be limited by the bandwidth (I dont think). If this was a back-end storage server, the network probably wouldn't be the limiting factor. Duncan Tim Newsham http://

Re: [Haskell-cafe] code review? store server, 220loc.

2008-08-03 Thread Tim Newsham
handle two client connections (via forkIO) concurrently, right? [ps: the same web directory has test clients and other versions of the server.] Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

[Haskell-cafe] code review? store server, 220loc.

2008-08-02 Thread Tim Newsham
ction. So it seems at least competitive with a forking C server. I havent tested threaded C servers. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] ghc socket weirdness

2008-07-24 Thread Tim Newsham
inking ... done. *** Exception: getAddrInfo: does not exist (servname not supported for ai_socktype) (same error when compiled). Anyone seen this before? I have multiple NICs, could that be confusing listenOn (does it not just bind on 0.0.0.0?) Tim Newsham http://www.thenewsh.com/~n

[Haskell-cafe] Gtk2Hs and GCs

2008-06-18 Thread Tim Newsham
-UI-Gtk-General-Style.html it looks like you can only get Colors, not the whole GC. I can't seem to find any other way short of making a whole new GC (as is done in Gtk2Hs/demos/graphic/Drawing.hs). Am I missing something? Is there a reason the GC's arent retrievable? Tim Newsham http://

[Haskell-cafe] re: very hard to build darcs with win32 ghc-6.8.2!

2008-06-05 Thread Tim Newsham
get it from an external source (such as the prebuilt libcurl library package). Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] very hard to build darcs with win32 ghc-6.8.2!

2008-06-04 Thread Tim Newsham
"SleepEx" c_SleepEx :: CUInt -> CInt -> IO CInt main = do putStrLn "start" n <- c_SleepEx (2*1000) 1 print n --- So, what is going on with ghc-6.8.2? Why is the gcc so hard to use now? Why can't I get FFI working with standard win32 functions? Wh

[Haskell-cafe] reordering pure bindings in monads

2008-05-29 Thread Tim Newsham
snt change the dependencies - x1 isnt used between the original line and its new position - there are no new bindings for x2' introduced between the original line and the new line. Did I overlook anything? Do any haskell implementations allow re

[Haskell-cafe] A mini haskell (in 244 lines of python)

2008-03-02 Thread Tim Newsham
es (nubBy (\x \y (eq (mod y x) 0)) from2) (traceList Val (take 10 primes)) ]]] which calculates the first 10 primes. Exercise to the reader: I bet the evaluator could all be written much more compactly in Haskell. Tim Newsham http://

[Haskell-cafe] strange GHC assembler failure

2008-02-02 Thread Tim Newsham
working on and it makes use of FFI and references external headers and libraries. (I put a copy at http://www.thenewsh.com/~newsham/silc-client.tgz if it helps anyone debug.. this is not release-quality code though). Any idea what is going on here? Tim Newsh

Re: [Haskell-cafe] weird behavior with FFI

2008-02-02 Thread Tim Newsham
Am Samstag, 2. Februar 2008 schrieb Tim Newsham: I am working on haskell bindings to C functions using FFI. I have a callback function that returns "IO ()". When I pass in the callback function: I suspect this has to do with printf returning 'undefined' if you us

[Haskell-cafe] weird behavior with FFI

2008-02-02 Thread Tim Newsham
: uncaught exception however, if I pass in the callback function: foo = do printf "foo" return () it does not crash. Is this a bug in my bindings? In ghc/ffi? Full code is at: http://www.thenewsh.com/%7Enewsham/silcbot.tgz Tim Newsham ht

Re: [Haskell-cafe] IO is a bad example for Monads

2007-12-11 Thread Tim Newsham
he best resources for learning Haskell are still academic papers published by language researchers. We've still got a long long way to go... Sure there's no shortcut to learning difficult concepts, but right now its more of a nature hike than a freeway... Mike Tim

Re: [Haskell-cafe] do

2007-12-03 Thread Tim Newsham
d understandable to teach do-notation first. Denis Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] binary operator modifiers

2007-11-19 Thread Tim Newsham
ewsham/Hats.pdf Though I don't know if you can coax lhs2tex into accepting something like %format -:liftM2 (+):- = "\widehat{+}" Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://ww

Re: [Haskell-cafe] Why are OCaml and Haskell being used at these companies?

2007-11-13 Thread Tim Newsham
Consultancy Ltd. http://www.ffconsultancy.com/products/?e Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] generating Maybe

2007-11-07 Thread Tim Newsham
| otherwise = Nothing such a function in the std libs would make functions like "unfoldr" more attractive -- uses of foldr nearly always encapsulate this notion. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Standalone PNG module?

2007-11-07 Thread Tim Newsham
Peter Verswyvelen wrote: I would like to load 32-bit images (RGB+alpha) for use with GLUT/OpenGL. I know GTK2HS has support for loading images, but does a standalone Haskell (wrapper) module exists for loading images? See the message "PNG files" by Tim Newsham, sent to haskell-c

Re: [Haskell-cafe] Re: Why can't Haskell be faster?

2007-11-01 Thread Tim Newsham
low-level stuff. The haskell entries to the shootout are very obviously written for speed and not elegance. If you want to do better on the LoC measure, you can definitely do so (at the expense of speed). -k Tim Newsham http://www.thenewsh.co

Re: [Haskell-cafe] binary operator modifiers

2007-10-31 Thread Tim Newsham
ms worth it, unfortunately. Hmm.. that might be decent if you added rules to pretty-print them in lhs2tex. The src code would be slightly messy but the formatted code would be very clean. And it opens the doors for other binop decorators. Interesting idea. -Brent Tim Newsham http://www.t

[Haskell-cafe] PNG files

2007-10-29 Thread Tim Newsham
I needed something small for writing out png files and didn't see anything, so I wrote my own. It's not really large or general enough yet to warrant a full package. It wouldn't require much work to support other variant formats, such as color. Png.hs {- A small library for creatin

[Haskell-cafe] binary operator modifiers

2007-10-28 Thread Tim Newsham
able to use them infix? If not, has anyone considered supporting strange syntaxes like this? Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] viewing HS files in Firefox

2007-10-28 Thread Tim Newsham
nd go back to your browser and click on the file. It should now open up in wordpad each time. At least that is the behavior in IE. Thanks, Isaac Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-18 Thread Tim Newsham
rop !a justified this isomorphism. Or am I still just not getting it? That would allow you to use the dynamic property (I observed termination) to verify the static property (the function is total) in some situations, right? But the static property of totality shouldn't rely on evaluation strate

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Tim Newsham
7;t read a good treatment of it yet. Do you have any pointers to something I could read? Vitaliy. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Tim Newsham
hank you! Krzysztof Kościuszkiewicz Skype: dr.vee, Gadu: 111851, Jabber: [EMAIL PROTECTED] Mobile IRL: +353851383329, Mobile PL: +48783303040 "Simplicity is the ultimate sophistication" -- Leonardo da Vinci Tim Newsham http://www.thenewsh.com/~newsham/___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-16 Thread Tim Newsham
A tutorial on the Curry-Howard Correspondence in Haskell: http://www.thenewsh.com/%7Enewsham/formal/curryhoward/ Feedback appreciated. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] haskell-curry, classical logic, excluded middle

2007-10-14 Thread Tim Newsham
henewsh.com/%7Enewsham/formal/curryhoward/IntLogic.hs http://www.thenewsh.com/%7Enewsham/formal/curryhoward/ClassLogic.hs and example theorems: http://www.thenewsh.com/%7Enewsham/formal/curryhoward/IntTheorems.hs http://www.thenewsh.com/%7Enewsham/formal/curryhoward/ClassTheorems.hs Should this go up

Re: [Haskell-cafe] haskell-curry, classical logic, excluded middle

2007-10-14 Thread Tim Newsham
-> r) run :: Prop p -> (p -> r) -> r run (Prop f) k = f k propCC :: ((forall q. p -> Prop q) -> Prop p) -> Prop p propCC f = Prop (\k -> run (f (\a -> Prop (\k' -> k a))) k) Zun. Tim Newsham http://www.thenewsh.com/~newsham/ __

[Haskell-cafe] haskell-curry, classical logic, excluded middle

2007-10-14 Thread Tim Newsham
at Classic2.hs:113:44 `q1' is bound by the type signature for `func1' at Classic2.hs:110:45 Expected type: Prop r q Inferred type: Prop r q1 In the expression: k (OrL k') In the definition of `func2': func2 k' = k (OrL k') -} -- False-Elimination -- (~P |- False) |- P Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] New slogan for haskell.org

2007-10-11 Thread Tim Newsham
"Haskell -- You're probably not smart enough to understand it." You are not expected to understand this. http://swtch.com/unix/ Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@h

[Haskell-cafe] Fusing foldr's

2007-10-11 Thread Tim Newsham
. foldr (\n -> (+n) *** (+1)) (0, 0) main = do print $ avg1 [1,2,3,4] print $ avg2 [1,2,3,4] print $ avg3 [1,2,3,4] Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Extract source code from literate Haskell (LHS) files

2007-09-30 Thread Tim Newsham
ot;>". The second expression removes the ">" at the beginning of each line. or if you prefer to keep the comments: sed -e 's/^[^>]/-- /g' -e 's/^>//g' < foo.lhs > foo.hs the first expression puts "-- " at

Re: [Haskell-cafe] Rewriting filter with foldr

2007-09-30 Thread Tim Newsham
= (5:) ((6:) []) (6:))= (5:) [6] (5:))= [5, 6] So you can see that its building up a chain of one-argument functions such as: (5:) (id ((6:) [])) before collapsing it down to a list like [5,6] (note to save space, I collapsed the "id" term early. If

[Haskell-cafe] some simple proof exercises

2007-09-28 Thread Tim Newsham
/%7Enewsham/formal/problems/set2.html Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] simple parsing (parsec) intro

2007-09-09 Thread Tim Newsham
/formal/parse/parser.lhs Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] IO in HApps handler ?

2007-08-19 Thread Tim Newsham
; I don't know the specifics. Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Small proof intro

2007-08-13 Thread Tim Newsham
I put together a small intro lesson on proving haskell code using quickcheck, equational reasoning and Isabelle/HOL. Its very elementary, but might be of interest to some people here. http://www.thenewsh.com/%7Enewsham/formal/reverse/ Feedback is appreciated. Tim Newsham http

[Haskell-cafe] FreeBSD/amd64 support?

2007-08-04 Thread Tim Newsham
all and run an x86 ghc in FreeBSD/amd64)? Is hardware access holding anyone up? Tim Newsham http://www.thenewsh.com/~newsham/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] problem with IO, strictness, and "let"

2007-07-16 Thread Tim Newsham
file, the stream will suddenly end. I believe silent data corruption is worse than a crash :) (currently, hGetContents also truncates on I/O error, but that's much less common and syslog will tell you about it anyway) Why can't hClose be more... um... lazy? Stefan Tim Newsham htt

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Tim Newsham
Is there a particular module you're having trouble with? Or just griping in general? =) How about STM? It would be nice if I didn't have to scan the paper each time I do something with STM. Isn't that the point of having an API reference? -Brent Tim Newsham http://w

  1   2   >