[Haskell-cafe] Documentation bug -- building ghc from darcs sources
I've been trying to build ghc head from the darcs repo using these instructions: http://hackage.haskell.org/trac/ghc/wiki/Building/GettingTheSources Unfortunately, when I do ./darcs-all --extra get as described under Getting more packages it fails because the darcs-all script doesn't recognize the --extra option. Was this removed recently, and if so, how do I achieve the same effect? TIA, Mike ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ghci and applicative
Hi, I'm finding that some data types which use Applicative to instantiate the Num class, give responses I wasn't expecting at the ghci prompt. A simple example is list: import Control.Applicative instance (Num a) = Num [a] where as + bs = (+) $ as * bs (*) = undefined;abs = undefined signum = undefined; fromInteger = undefined f1 = let op = (+) in [1,2,3] `op` [1,1,1] f2 = let op = (+) in op [1,2,3] [1,1,1] Functions f1 and f2 give no problems at the ghci prompt. However if I instead type the body of either interactively, I get an error: *Main let op = (+) *Main [1,2,3] `op` [1,1,1] interactive:1:0: Couldn't match expected type `Integer' against inferred type `[a]' In the first argument of `op', namely `[1, 2, 3]' In the expression: [1, 2, 3] `op` [1, 1, 1] In the definition of `it': it = [1, 2, 3] `op` [1, 1, 1] I get the same error message with op [1,2,3] [1,1,1]. Any thoughts? Thanks, Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ghci and applicative
:set -XNoMonomorphismRestriction or eta-expand: let op x y = x+y The problem is that op looks like a value to the user, but it's a function (based on the dictionary passed in), which means that any evaluation it does isn't shared between instances. Consider: f1 = let v = fib 1 in \x - x + v f1 :: Integer - Integer only calculates fib 1 once, but, f1 :: Num a = a - a calculates fib 1 every time you call it. This can lead some programs to take exponentially longer than they seem like they should. -- ryan On Fri, Jun 12, 2009 at 12:13 AM, Paul Keirpk...@dcs.gla.ac.uk wrote: Hi, I'm finding that some data types which use Applicative to instantiate the Num class, give responses I wasn't expecting at the ghci prompt. A simple example is list: import Control.Applicative instance (Num a) = Num [a] where as + bs = (+) $ as * bs (*) = undefined; abs = undefined signum = undefined; fromInteger = undefined f1 = let op = (+) in [1,2,3] `op` [1,1,1] f2 = let op = (+) in op [1,2,3] [1,1,1] Functions f1 and f2 give no problems at the ghci prompt. However if I instead type the body of either interactively, I get an error: *Main let op = (+) *Main [1,2,3] `op` [1,1,1] interactive:1:0: Couldn't match expected type `Integer' against inferred type `[a]' In the first argument of `op', namely `[1, 2, 3]' In the expression: [1, 2, 3] `op` [1, 1, 1] In the definition of `it': it = [1, 2, 3] `op` [1, 1, 1] I get the same error message with op [1,2,3] [1,1,1]. Any thoughts? Thanks, Paul ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] exporting Data.ByteString functions via FFI
Hi, I was trying to write a FFI wrapper for my Haskell program which manipulates ByteString. But I am unable to compile/link it. Here is the toy program. {-# LANGUAGE ForeignFunctionInterface #-} module B where import Foreign.C.Types import Foreign.C.String import qualified Data.ByteString as BS rev :: BS.ByteString - BS.ByteString rev bstr = BS.reverse bstr rev_hs :: CString - IO CString rev_hs cstr = do { bstr - BS.packCString cstr ; let bstr' = rev bstr ; cstr' - newCString (show bstr') ; return cstr' } foreign export ccall rev_hs :: CString - IO CString And here is the C counter-part. #include B_stub.h #include stdio.h int main(int argc, char *argv[]) { char *str; hs_init(argc, argv); str = rev_hs(it works.); printf(Rev: %s\n, str); hs_exit(); return 0; } Compiling B.hs alone seems fine, but errors popped up when I was trying to compile/link it with C. $ ghc -c -O B.hs $ ghc -optc-O test_b.c B.o B_stub.o -o test_b Undefined symbols: ___stginit_bytestringzm0zi9zi1zi4_DataziByteString_, referenced from: ___stginit_Lib_ in B.o _bytestringzm0zi9zi1zi4_DataziByteString_zdwreverse_info, referenced from: _s19w_info in B.o _bytestringzm0zi9zi1zi4_DataziByteStringziInternal_zdwshowsPrec_info, referenced from: _s19v_info in B.o _bytestringzm0zi9zi1zi4_DataziByteStringziInternal_zdwshowsPrec_closure, referenced from: _Lib_zdwa_srt in B.o _bytestringzm0zi9zi1zi4_DataziByteString_zdwa4_info, referenced from: _Lib_zdwa_info in B.o _bytestringzm0zi9zi1zi4_DataziByteString_reverse_info, referenced from: _Lib_rev_info in B.o ld: symbol(s) not found collect2: ld returned 1 exit status If I replace ByteString with the ordinary String, the above programs can be compiled and linked. Can someone tell me what I did wrong here? -Kenny ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] exporting Data.ByteString functions via FFI
kenny lu wrote: Hi, I was trying to write a FFI wrapper for my Haskell program which manipulates ByteString. But I am unable to compile/link it. Here is the toy program. {-# LANGUAGE ForeignFunctionInterface #-} module B where import Foreign.C.Types import Foreign.C.String import qualified Data.ByteString as BS rev :: BS.ByteString - BS.ByteString rev bstr = BS.reverse bstr rev_hs :: CString - IO CString rev_hs cstr = do { bstr - BS.packCString cstr ; let bstr' = rev bstr ; cstr' - newCString (show bstr') ; return cstr' } foreign export ccall rev_hs :: CString - IO CString And here is the C counter-part. #include B_stub.h #include stdio.h int main(int argc, char *argv[]) { char *str; hs_init(argc, argv); str = rev_hs(it works.); printf(Rev: %s\n, str); hs_exit(); return 0; } Compiling B.hs alone seems fine, but errors popped up when I was trying to compile/link it with C. $ ghc -c -O B.hs $ ghc -optc-O test_b.c B.o B_stub.o -o test_b Undefined symbols: ___stginit_bytestringzm0zi9zi1zi4_DataziByteString_, referenced from: ___stginit_Lib_ in B.o _bytestringzm0zi9zi1zi4_DataziByteString_zdwreverse_info, referenced from: _s19w_info in B.o _bytestringzm0zi9zi1zi4_DataziByteStringziInternal_zdwshowsPrec_info, referenced from: _s19v_info in B.o _bytestringzm0zi9zi1zi4_DataziByteStringziInternal_zdwshowsPrec_closure, referenced from: _Lib_zdwa_srt in B.o _bytestringzm0zi9zi1zi4_DataziByteString_zdwa4_info, referenced from: _Lib_zdwa_info in B.o _bytestringzm0zi9zi1zi4_DataziByteString_reverse_info, referenced from: _Lib_rev_info in B.o ld: symbol(s) not found collect2: ld returned 1 exit status If I replace ByteString with the ordinary String, the above programs can be compiled and linked. Can someone tell me what I did wrong here? Add -package bytestring to the ghc command line options. I believe that adding --make also may work. Regards, -- Jochem Berndsen | joc...@functor.nl GPG: 0xE6FABFAB ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] exporting Data.ByteString functions via FFI
It works indeed. Thanks. -Kenny On Fri, Jun 12, 2009 at 3:50 PM, Jochem Berndsen joc...@functor.nl wrote: kenny lu wrote: Hi, I was trying to write a FFI wrapper for my Haskell program which manipulates ByteString. But I am unable to compile/link it. Here is the toy program. {-# LANGUAGE ForeignFunctionInterface #-} module B where import Foreign.C.Types import Foreign.C.String import qualified Data.ByteString as BS rev :: BS.ByteString - BS.ByteString rev bstr = BS.reverse bstr rev_hs :: CString - IO CString rev_hs cstr = do { bstr - BS.packCString cstr ; let bstr' = rev bstr ; cstr' - newCString (show bstr') ; return cstr' } foreign export ccall rev_hs :: CString - IO CString And here is the C counter-part. #include B_stub.h #include stdio.h int main(int argc, char *argv[]) { char *str; hs_init(argc, argv); str = rev_hs(it works.); printf(Rev: %s\n, str); hs_exit(); return 0; } Compiling B.hs alone seems fine, but errors popped up when I was trying to compile/link it with C. $ ghc -c -O B.hs $ ghc -optc-O test_b.c B.o B_stub.o -o test_b Undefined symbols: ___stginit_bytestringzm0zi9zi1zi4_DataziByteString_, referenced from: ___stginit_Lib_ in B.o _bytestringzm0zi9zi1zi4_DataziByteString_zdwreverse_info, referenced from: _s19w_info in B.o _bytestringzm0zi9zi1zi4_DataziByteStringziInternal_zdwshowsPrec_info, referenced from: _s19v_info in B.o _bytestringzm0zi9zi1zi4_DataziByteStringziInternal_zdwshowsPrec_closure, referenced from: _Lib_zdwa_srt in B.o _bytestringzm0zi9zi1zi4_DataziByteString_zdwa4_info, referenced from: _Lib_zdwa_info in B.o _bytestringzm0zi9zi1zi4_DataziByteString_reverse_info, referenced from: _Lib_rev_info in B.o ld: symbol(s) not found collect2: ld returned 1 exit status If I replace ByteString with the ordinary String, the above programs can be compiled and linked. Can someone tell me what I did wrong here? Add -package bytestring to the ghc command line options. I believe that adding --make also may work. Regards, -- Jochem Berndsen | joc...@functor.nl GPG: 0xE6FABFAB ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/11 Thomas Davie tom.da...@gmail.com: Here's the logo, continuing on the batteries included theme: http://www.cs.kent.ac.uk/people/rpg/tatd2/HaskellBatteries.png I'd sugest a thinner and smaller lambda, or bigger (maybe longer) batteries. The + tip of the batteries should also be colored in gold. Loup. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Documentation bug -- building ghc from darcs sources
On 12/06/2009 08:00, Michael Vanier wrote: I've been trying to build ghc head from the darcs repo using these instructions: http://hackage.haskell.org/trac/ghc/wiki/Building/GettingTheSources Unfortunately, when I do ./darcs-all --extra get as described under Getting more packages it fails because the darcs-all script doesn't recognize the --extra option. Was this removed recently, and if so, how do I achieve the same effect? The --extra flag was removed recently, I've just updated the wiki pages to match. Thanks for spotting it. (in the future, posting to glasgow-haskell-us...@haskell.org will make it more likely we'll notice your message). Cheers, Simon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
On 12 Jun 2009, at 10:27, Loup Vaillant wrote: 2009/6/11 Thomas Davie tom.da...@gmail.com: Here's the logo, continuing on the batteries included theme: http://www.cs.kent.ac.uk/people/rpg/tatd2/HaskellBatteries.png I'd sugest a thinner and smaller lambda, or bigger (maybe longer) batteries. The + tip of the batteries should also be colored in gold. Hmm, I'm not sure I agree -- I think the main strength of the original logo is that it's simple, both in terms of all lines being the same width, and in terms of having only two colours used. It means it can be adapted to all sorts of different colour sets (as it is on Haskell.org). Perhaps the correct thing to do here is to make a black/gold version for the haskell platform? I do agree with the earlier comment that the font for the +/- needs to be more bold, if I'd had a vector version, I would have done that. Bob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo On Fri, Jun 12, 2009 at 10:39 AM, Thomas Davietom.da...@gmail.com wrote: On 12 Jun 2009, at 10:27, Loup Vaillant wrote: 2009/6/11 Thomas Davie tom.da...@gmail.com: Here's the logo, continuing on the batteries included theme: http://www.cs.kent.ac.uk/people/rpg/tatd2/HaskellBatteries.png I'd sugest a thinner and smaller lambda, or bigger (maybe longer) batteries. The + tip of the batteries should also be colored in gold. Hmm, I'm not sure I agree -- I think the main strength of the original logo is that it's simple, both in terms of all lines being the same width, and in terms of having only two colours used. It means it can be adapted to all sorts of different colour sets (as it is on Haskell.org). Perhaps the correct thing to do here is to make a black/gold version for the haskell platform? I do agree with the earlier comment that the font for the +/- needs to be more bold, if I'd had a vector version, I would have done that. Bob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan Attached is a new version of the same idea with a slight gradient on the batteries and a slightly thicker font for the signs. -- Deniz Dogan attachment: logo-1.svg___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan Attached is a new version of the same idea with a slight gradient on the batteries and a slightly thicker font for the signs. -- Deniz Dogan I realise now that I forgot the little head on the plus side of the battery, so you'll just have to imagine it's there. ;) -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
On 12 Jun 2009, at 11:15, Deniz Dogan wrote: 2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan Attached is a new version of the same idea with a slight gradient on the batteries and a slightly thicker font for the signs. With various people's ideas taken into account, I've created a new version of my attempt: http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.png http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.svg I think the yellow/black is easily enough to highlight it as a battery, and saves adding gradients etc, that can become awkward if the logo is ever used in printing. Bob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
2009/6/12 Thomas Davie tom.da...@gmail.com: On 12 Jun 2009, at 11:15, Deniz Dogan wrote: 2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan Attached is a new version of the same idea with a slight gradient on the batteries and a slightly thicker font for the signs. With various people's ideas taken into account, I've created a new version of my attempt: http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.png http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.svg I think the yellow/black is easily enough to highlight it as a battery, and saves adding gradients etc, that can become awkward if the logo is ever used in printing. Bob While I agree with you on the printing issue, I believe that we can use separate logos for web use (perhaps with gradients, depending on what others think) and another logo for printing. After all, one can argue that any colours apart from greyscale ones are non-optimal for printing as well, but that will not stop anyone from making a colourful logo. -- Deniz Dogan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
On Fri, Jun 12, 2009 at 11:25, Thomas Davietom.da...@gmail.com wrote: With various people's ideas taken into account, I've created a new version of my attempt: http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.png http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.svg I think the yellow/black is easily enough to highlight it as a battery, and saves adding gradients etc, that can become awkward if the logo is ever used in printing. Bob I like this last version a lot, except that the minus sign should be the same width and height as the horizontal bar of the plus sign. How about this? http://thomas.home.fmf.nl/haskell-platform-logo-bob-mod.svg It's an Inkscape svg file, easily editable. Thomas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [ANN] Data.Reify.CSE
Hi all, This module[1] implements common sub-expression elimination for graphs generated by the Data.Reify package. (Which is a really neat tool!) The algorithm performs a simple fixed point iteration and is not (consciously) optimized for speed. This package might especially be useful for optimizing simple compilers for referential transparent domain specific languages. Which is exactly the reason I've written this code. An example of the usage is included in the Haddock documentation. Gr, -- Sebastiaan Visser [1] http://hackage.haskell.org/package/data-reify-cse ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Software Transactional Memory and LWN
On Thursday 11 June 2009, Ketil Malde wrote: Hi, Browsing LWN, I ran across this comment: http://lwn.net/Articles/336039/ The author makes a bunch of unsubstantiated claims about STM, namely that all implementations use locking under the hood, and that STM can live- and deadlock. I've seen a lot of similar sentiments in other places as well (comp.arch springs to mind). Now, I'm no expert on STM, but I was pretty sure these are incorrect, and I certainly had the impression that Haskell's STM guarantees some progress - which it couldn't in a deadlock situation. Am I wrong? Hi, While I'm no STM expert either, I'd like to remind an often overlooked detail: locks and STM are two different abstractions. While locks provide semantics for running critical sections (informally, parts of code which only one thread can execute) STM provides semantics for atomic actions (informally, actions the intermediate state of which can't be observed by other threads). Now, while an STM implementation can use locks under the hood, it doesn't change the fact that the programmer isn't exposed to using those. Saying STM is bad because it uses locks under the hood is the same as saying that a garbage-collected environment is bad because it uses malloc and free under the hood. As far as the STM-is-better-because-it-doesn't-use-locks theory is concerned, the idea here is that STM doesn't associate a lock with every atomic section. This means that (in an optimistic implementation) any number of threads (and potentially CPU cores) can execute the atomic action in parallel, and if there are few rollbacks, this can lead to better performance than using a single lock[3]. And you can't forget about composability -- code written using locks is less modular than code written using STM. While either optimistic[1] or pessimistic[2] STM can livelock, this can be solved by some sort of exponential backoff algorithm (which does not guarantee progress, just makes a livelock less likely). As far as deadlock is concerned -- if we allow for retry, then as it has already been mentioned, there is a possibility for deadlock. But with STM, you can do deadlock detection by means of cycle detection in wait-for graphs (in much the same way as it is done in DBMS). While now STM usually performs worse than locks, it is an active area of research (even Intel released an experimental STM-supporing C++ compiler[4]). It is also true, that as the number of cores in cpus grows, STM will become more attractive. Thanks! Marcin Kosiba [1]http://en.wikipedia.org/wiki/Software_transactional_memory#Implementation_issues [2]when a long-lived transaction is rolled-back by small transactions [3]you can even switch between STM and locking: General and Efficient Locking without Blocking. Yannis Smaragdakis, Anthony Kay, Reimer Behrends, Michal Young [4]http://software.intel.com/en-us/articles/intel-c-stm-compiler-prototype-edition-20/ signature.asc Description: This is a digitally signed message part. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] ghci and applicative
Thanks Ryan, I'm slowly becoming aware of the effects of Monomorphism. I'll look again at Neil Mitchell's blog post. I guess it's the same thing when I try: let a = 1 a + 1.0 I'm taking the mono as a clue that the type inferencing will complete after each ghci carriage return; once only. In this example when a is set, it is to an Integer. One might imagine ghci could wait until I use a somewhere, but that's not how things are. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] ghci and applicative
On Fri, 2009-06-12 at 15:00 +0100, Paul Keir wrote: Thanks Ryan, I'm slowly becoming aware of the effects of Monomorphism. I'll look again at Neil Mitchell's blog post. I guess it's the same thing when I try: let a = 1 a + 1.0 I'm taking the mono as a clue that the type inferencing will complete after each ghci carriage return; once only. In this example when a is set, it is to an Integer. One might imagine ghci could wait until I use a somewhere, but that's not how things are. Or be explicit about it and give it a polymorphic type: Prelude let a :: Num a = a; a = 1 Prelude :t a a :: (Num a) = a Prelude a + 1.0 2.0 Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] graphical user interface library for editing graphs?
Greetings, I have an idea for a project. The eventual aim is rather eccentric, but the specifications I have sketched out are roughly as follows (best viewed with fixed-width font due to diagrams): 0. the graphical user interface is entirely mouse driven, mouse position/clicks/releases are shown by [ ] 1. the world consists of empty space, nodes, and links between nodes 2. nodes may either be filled (*) or hollow (o); call hollow nodes targets, targets may be highlighted (O) 3a. left-click on empty creates a filled node linked to a target: [ ]* = | o 3b. left-click on a target fills it and links it to a new target: : : [o]* = | o 4a. right-click on empty creates a filled node linked to two targets: [ ]* = / \ o o 4b. right-click on a target fills it and links it to two new targets: : : [o]* = / \ o o 5a. left-click-drag on a filled node with 1 descending link highlights all targets linked under it: : : [*] [*] : =: * * / \ / \ o o O O 5b. left-click-drag as in 5a, when released on a highlighted target, creates a weak link (not considered as descending for purposes of 5a) from the original node to that target. that target is filled, all other targets are unhighlighted: : : * * : =:\ * * \ / \ / \| O [O]o [*] 6a. right-click-drag from a filled node at the top of a connected component highlights all targets not in that connected component: [*] * [*] * : | = : | o O 6b. right-click-drag as in 6a, when released on a highlighted target, joins the graphs together, such that the original node fills that target, and all other targets are unhighlighted: * * * : | = | [O] [*] : 7. when a connected component has no targets, double-clicking anywhere on it will launchMissiles My question: can you suggest a library that would make implementing this specification relatively painless? OpenGL-based would be preferable, as I would like to scale the graph under construction automatically to fit the display, and launchMissiles will require something with fast rendering. Thanks, Claude -- http://claudiusmaximus.goto10.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Why do ghc-built binaries use timer_create?
On 08/06/2009 22:10, Maurício wrote: This comes from an issue in haskell-beginner, (...) For better or worse, this is something that people should not be trying in the first place, (...) Sure! That's what I sugested in the original question. I'm actually just curious on why timer_create is used at all. This is probably just a small detail in program initialization, and maybe a link to some description of what happens on program initialization (specially ghc generated binaries) behind the naive user view would do it. timer_create is used in the RTS to create a regular tick signal. The tick signal is used for various things: thread pre-emption, profiling, deadlock detection, and idle-time GC, Cheers, Simon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Debugging misbehaving multi-threaded programs
On 11/06/2009 05:40, Evan Klitzke wrote: I've written a multi-threaded Haskell program that I'm trying to debug. Basically what's happening is the program runs for a while, and then at some point one of the threads goes crazy and spins the CPU while allocating memory; this proceeds until the system runs out of available memory. I can't fix this without figuring out what code is being executed in the loop (or at least which thread is misbehaving, which would narrow things down a lot). I was hopeful that I could compile the program with profiling support and then use +RTS -M100M along with some of the RTS profiling options and get profiling information on CPU and memory usage at the time that my program runs out of memory. The thinking here is that nearly all of the CPU time and heap space will be from the misbehaving thread, so at that point I could do more investigation into exactly what is happening. Unfortunately, this doesn't seem to work; whenever the program terminates due to running out of heap space, the generated .prof file is empty. We fixed this recently (GHC 6.10.2): http://hackage.haskell.org/trac/ghc/ticket/2592 In 6.12.1 you'll be able to use ThreadScope, our parallel profiling tool. You could try it right now if you're brave enough to compile GHC (it needs GHC 6.11). The ThreadScope code is here: http://code.haskell.org/ThreadScope/ and shortly the Haskell Symposium paper about it will be available (we're just making the final corrections now). Cheers, Simon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Wiki user accounts
I'm hearing reports of people having difficulty obtaining accounts on the Haskell wiki, without which it is impossible to make edits. Currently, account creation is disabled as an anti-spam measure, and the idea is for people to mail the admin and request an account. If this is to work, accounts need to be granted reasonably quickly - so far, I'm aware of a case where after 4 days there has been no response. This is particularly problematic for Anglohaskell, as signups and the like are via the wiki page - as a temporary workaround, I'll (and anyone else willing to lend a hand who already has an account) have to make edits on others' behalf, which is a serious inconvenience for both myself and attendees, as well as something of a barrier to entry. What's going on, and how can we speed things up? -- Philippa Cowderoy fli...@flippac.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wiki user accounts
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Jun 12, 2009 at 11:58 AM, Philippa Cowderoy wrote: I'm hearing reports of people having difficulty obtaining accounts on the Haskell wiki, without which it is impossible to make edits. Currently, account creation is disabled as an anti-spam measure, and the idea is for people to mail the admin and request an account. If this is to work, accounts need to be granted reasonably quickly - so far, I'm aware of a case where after 4 days there has been no response. This is particularly problematic for Anglohaskell, as signups and the like are via the wiki page - as a temporary workaround, I'll (and anyone else willing to lend a hand who already has an account) have to make edits on others' behalf, which is a serious inconvenience for both myself and attendees, as well as something of a barrier to entry. What's going on, and how can we speed things up? Presumably Ashley is busy. http://haskell.org/haskellwiki/?title=Special%3AListusersgroup=sysop There are only 3 bureaucrats/admins; one is a dummy account, one is Ashley, and one is John Peterson (who hasn't edited for a year). One solution would be to have Ashley re-enable user registrations. This has been suggested before, but no one knows how bad the spam would be. Another solution would be to sysop a few users to admin/bureaucrat, so that even if a few are inactive or away, the rest can handle requests. If I might suggest some users we might give the bit to: myself, dons, Magnus Therning, Neil Mitchell, and byorgey. All have been editing the wiki for some time, some have administrator experience on Wikipedia, and all have commit bits for various Haskell repos (and so presumably can be trusted). (Of course, this list isn't intended to be exhaustive; they're just who comes to mind looking over Recent Changes.) - -- gwern -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEAREKAAYFAkoyhm8ACgkQvpDo5Pfl1oLTzACfff/rM02Fy/b/VbCwIqgaWO/B 39QAnAkZGKyOTg2zVpDw7NcwNkaED7Ln =KXdO -END PGP SIGNATURE- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wiki user accounts
This runs on MediaWiki, right? How about adding a CAPTCHA for account registrations? http://www.mediawiki.org/wiki/Extension:ConfirmEdit And, more generally: http://www.mediawiki.org/wiki/Manual:Combating_spam Cheers, Thomas On Fri, Jun 12, 2009 at 18:46, Gwern Branwengwe...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Jun 12, 2009 at 11:58 AM, Philippa Cowderoy wrote: I'm hearing reports of people having difficulty obtaining accounts on the Haskell wiki, without which it is impossible to make edits. Currently, account creation is disabled as an anti-spam measure, and the idea is for people to mail the admin and request an account. If this is to work, accounts need to be granted reasonably quickly - so far, I'm aware of a case where after 4 days there has been no response. This is particularly problematic for Anglohaskell, as signups and the like are via the wiki page - as a temporary workaround, I'll (and anyone else willing to lend a hand who already has an account) have to make edits on others' behalf, which is a serious inconvenience for both myself and attendees, as well as something of a barrier to entry. What's going on, and how can we speed things up? Presumably Ashley is busy. http://haskell.org/haskellwiki/?title=Special%3AListusersgroup=sysop There are only 3 bureaucrats/admins; one is a dummy account, one is Ashley, and one is John Peterson (who hasn't edited for a year). One solution would be to have Ashley re-enable user registrations. This has been suggested before, but no one knows how bad the spam would be. Another solution would be to sysop a few users to admin/bureaucrat, so that even if a few are inactive or away, the rest can handle requests. If I might suggest some users we might give the bit to: myself, dons, Magnus Therning, Neil Mitchell, and byorgey. All have been editing the wiki for some time, some have administrator experience on Wikipedia, and all have commit bits for various Haskell repos (and so presumably can be trusted). (Of course, this list isn't intended to be exhaustive; they're just who comes to mind looking over Recent Changes.) - -- gwern -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEAREKAAYFAkoyhm8ACgkQvpDo5Pfl1oLTzACfff/rM02Fy/b/VbCwIqgaWO/B 39QAnAkZGKyOTg2zVpDw7NcwNkaED7Ln =KXdO -END PGP SIGNATURE- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wiki user accounts
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Fri, Jun 12, 2009 at 1:53 PM, Thomas ten Cate wrote: This runs on MediaWiki, right? How about adding a CAPTCHA for account registrations? http://www.mediawiki.org/wiki/Extension:ConfirmEdit See http://haskell.org/haskellwiki/Special:Version ConfirmEdit would require an upgrade. - -- gwern -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEAREKAAYFAkoym4gACgkQvpDo5Pfl1oJHAwCghVWZxh2O+zi4WNp2VHBytXTH a6EAn2wlTz/pjp7vUfuaWZJ1WpNuyQ7m =k/yM -END PGP SIGNATURE- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wiki user accounts
Am Freitag 12 Juni 2009 18:46:41 schrieb Gwern Branwen: There are only 3 bureaucrats/admins; one is a dummy account, one is Ashley, and one is John Peterson (who hasn't edited for a year). One solution would be to have Ashley re-enable user registrations. This has been suggested before, but no one knows how bad the spam would be. Another solution would be to sysop a few users to admin/bureaucrat, so that even if a few are inactive or away, the rest can handle requests. I support that. If I might suggest some users we might give the bit to: myself, dons, Magnus Therning, Neil Mitchell, and byorgey. I consider these users trustworthy. Which of them besides Gwern are willing to take the job? All have been editing the wiki for some time, some have administrator experience on Wikipedia, and all have commit bits for various Haskell repos (and so presumably can be trusted). (Of course, this list isn't intended to be exhaustive; they're just who comes to mind looking over Recent Changes.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wiki user accounts
Daniel Fischer wrote: Am Freitag 12 Juni 2009 18:46:41 schrieb Gwern Branwen: There are only 3 bureaucrats/admins; one is a dummy account, one is Ashley, and one is John Peterson (who hasn't edited for a year). One solution would be to have Ashley re-enable user registrations. This has been suggested before, but no one knows how bad the spam would be. Another solution would be to sysop a few users to admin/bureaucrat, so that even if a few are inactive or away, the rest can handle requests. I support that. If I might suggest some users we might give the bit to: myself, dons, Magnus Therning, Neil Mitchell, and byorgey. I consider these users trustworthy. Which of them besides Gwern are willing to take the job? Cool, I'm up for it! /M -- Magnus Therning(OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe signature.asc Description: OpenPGP digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wiki user accounts
On Fri, Jun 12, 2009 at 07:53:41PM +0200, Thomas ten Cate wrote: This runs on MediaWiki, right? How about adding a CAPTCHA for account registrations? What do we avoid at all costs? ___ |___| -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ghci and applicative
On Fri, Jun 12, 2009 at 03:00:12PM +0100, Paul Keir wrote: Thanks Ryan, I'm slowly becoming aware of the effects of Monomorphism. I'll look again at Neil Mitchell's blog post. I guess it's the same thing when I try: let a = 1 a + 1.0 I'm taking the mono as a clue that the type inferencing will complete after each ghci carriage return; once only. In this example when a is set, it is to an Integer. One might imagine ghci could wait until I use a somewhere, but that's not how things are. It can wait. You just have to turn off the monomorphism restriction (recommended). Prelude :set -XNoMonomorphismRestriction Prelude let a = 1 Prelude a + 2.0 3.0 You can even add :set -XNoMonomorphismRestriction to your .ghci file so that it is always turned off in ghci. -Brent ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Wiki user accounts
On Fri, Jun 12, 2009 at 08:22:25PM +0200, Daniel Fischer wrote: Am Freitag 12 Juni 2009 18:46:41 schrieb Gwern Branwen: There are only 3 bureaucrats/admins; one is a dummy account, one is Ashley, and one is John Peterson (who hasn't edited for a year). One solution would be to have Ashley re-enable user registrations. This has been suggested before, but no one knows how bad the spam would be. Another solution would be to sysop a few users to admin/bureaucrat, so that even if a few are inactive or away, the rest can handle requests. I support that. If I might suggest some users we might give the bit to: myself, dons, Magnus Therning, Neil Mitchell, and byorgey. I consider these users trustworthy. Which of them besides Gwern are willing to take the job? Fine with me. -Brent ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo fun
Nice work, I love this one. :-) On Fri, Jun 12, 2009 at 3:25 AM, Thomas Davie tom.da...@gmail.com wrote: On 12 Jun 2009, at 11:15, Deniz Dogan wrote: 2009/6/12 Deniz Dogan deniz.a.m.do...@gmail.com: 2009/6/12 Tom Lokhorst t...@lokhorst.eu: There's a SVG version of the logo on the wiki: http://haskell.org/haskellwiki/Thompson-Wheeler_logo I think the biggest problem making the batteries not look like batteries is that they don't look round. For that we need some careful gradenting of them, to make the bottoms of them look shadowed. -- Deniz Dogan Attached is a new version of the same idea with a slight gradient on the batteries and a slightly thicker font for the signs. With various people's ideas taken into account, I've created a new version of my attempt: http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.png http://www.cs.kent.ac.uk/people/rpg/tatd2/logo-1.svg I think the yellow/black is easily enough to highlight it as a battery, and saves adding gradients etc, that can become awkward if the logo is ever used in printing. Bob ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [ANN] Nemesis : easy task management
You can have a description file named Nemesis, with content nemesis = do clean [ **/*.hi , **/*.o , manifest ] task dist $ do sh cabal clean sh cabal configure sh cabal sdist task i (sh ghci -isrc src/System/Nemesis.hs) task manifest $ do sh find . | grep 'hs$' manifest then after run `nemesis`, there will be a compiled bin `nem` in your local path, which allows you to do `nem clean` Install with `cabal install nemesis` Cheers, -- jinjing ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] HSH and IO ()
John all, I use HSH in my project where several external programs and Haskell functions need to be piped together: HSH is of great help here. I however came across the situation when one of pipe-connected functions has signature IO (), yet it reads from stdin* and writes to stdout. The documentation mentions instance ShellCommand (Handle - Handle - IO ()) which could be of some help, but in the latest version of HSH on Hackage this instance is commented out. What was the reason of doing that? Is this to be expected in the upcoming versions? Thank you. * I modelled that by calling getContents, but the actual program will call a foreign library that contains a C function that reads from stdin (that is, FILE *), and that cannot be changed easily. -- Dimitry Golubovsky Anywhere on the Web ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell Meetup groups in Glasgow
Do any Haskell Meetup groups exist in or around Glasgow, an informal get-to-gether in a pub,cafe or wherever ? I'm in Edinburgh, and on my own have been desperately trying to rewire my brain from Perl to Haskell without much success for most of this year. I posted the meetup group question a few weeks ago for Edinburgh but got no response. -- Andrew ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: HSH and IO ()
Dimitry Golubovsky wrote: John all, I use HSH in my project where several external programs and Haskell functions need to be piped together: HSH is of great help here. I however came across the situation when one of pipe-connected functions has signature IO (), yet it reads from stdin* and writes to stdout. The documentation mentions instance ShellCommand (Handle - Handle - IO ()) which could be of some help, but in the latest version of HSH on Hackage this instance is commented out. What was the reason of doing that? Is this to be expected in the upcoming versions? Yes; that's due to the new more flexible way of sending data between processes in HSH -- the Channel. You can replace it with a function that can take any Channel, and produce a result as a Channel of one particular sort. In particular, this instance: instance ShellCommand (Channel - IO Channel) where is the direct replacement for what you were doing. A Channel is generally a String, a lazy ByteString, or a Handle. There are helper functions in HSH.Channel to deal with these: chanAsString, chanAsBSL, and chanToHandle. You can think of the first two as similar to hGetContents. The last will write the channel out literally to a passed-along handle. So, let's say that you wanted to process input as a String, and before you were given a Handle that you used hGetContents on. Now, you will get a Channel, on which you will call chanAsString. It will convert whatever type of Channel you were handed into a String, lazily. Does that make sense? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe