[Haskell-cafe] Re: Re[2]: Why monad tutorials don't work

2007-08-15 Thread Dominic Steinitz
Miguel Mitrofanov miguelimo38 at yandex.ru writes: Grrr...must...hold...my...tongue... Dan, as a former student of a clone of that physics teacher, I am really interested in what you will say when you fail to hold your tongue. -- Bill Wood MV I have to admit I was wondering

[Haskell-cafe] Re: Re[2]: Why monad tutorials don't work

2007-08-15 Thread Dominic Steinitz
Dan Piponi dpiponi at gmail.com writes: On 8/15/07, Dan Weston westondan at imageworks.com wrote: You too could have invented Universal Algebra and Category Theory. I nominate Dan Piponi to write it and eagerly await its release! I've already started on it. Well, that's not the exact

[Haskell-cafe] ICMP in Haskell (was Elevator pitch for Haskell)

2007-09-09 Thread Dominic Steinitz
Does it enable you to, say, send raw ICMP packets? AFAIK, Haskell supports TCP, and nothing else. (A while back I wanted to write an automated pinging program. But the only way I could figure out how to do it is to call the OS ping utility and attempt to parse what it writes to stdout.

[Haskell-cafe] Sequencing Operations in a Monad

2007-09-15 Thread Dominic Steinitz
If you arrange the types to try to do all the operations inside the IO monad you can't chain together more than 1 binary operation. eg. do S - A + B Z - Q * S vs do S - Q * (A + B) Are there any suggestions for this dilemma? Am I using the wrong monad for this task?

[Haskell-cafe] Library Process (was Building production stable software in Haskell)

2007-09-18 Thread Dominic Steinitz
This discussion has sparked a question in my mind: What is the process for the inclusion of modules / packages in ghc, hugs and other compilers interpreters? I thought the master plan was that less would come with the compiler / interpreter and the user would install packages using cabal. I

[Haskell-cafe] Re: Very crazy

2007-09-25 Thread Dominic Steinitz
Andrew Coppin andrewcoppin at btinternet.com writes: I just found it rather surprising. Every time *I* try to compose with functions of more than 1 argument, the type checker complains. Specifically, suppose you have foo = f3 . f2 . f1 Assuming those are all 1-argument functions, it

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

2007-09-30 Thread Dominic Steinitz
Peter Verswyvelen bf3 at telenet.be writes: to do manually, but does a command line tool exist for extracting source code from literate Haskell files? Thanks, Peter lhs2tex will do this for you. ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: Function composition

2007-10-04 Thread Dominic Steinitz
Look at the type of (.).(.).(.) Dominic. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: The Exp - Term a problem (again), how to dynamically create (polymorphic) typed terms in Haskell ??

2007-10-04 Thread Dominic Steinitz
Did you look at Ralf Hinze's paper Fun with Phantom Types? Dominic. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: MD5?

2007-11-10 Thread Dominic Steinitz
Neil Mitchell ndmitchell at gmail.com writes: Hi The final alternative is that I just call MD5SUM.EXE from my Haskell program and try to parse the output. But that strikes me as rather messy. Messy, but I don't see any disadvantage to doing it this way - if you can control that the

[Haskell-cafe] A Random Question

2007-12-15 Thread Dominic Steinitz
I need to generate distinct arbitrary values for my quickcheck tests and they don't have to be arbitrary (although that doesn't matter). No problem I thought, I'll create my own random number generator (which will not be random at all) and use choose :: forall a. (Random a) = (a, a) - Gen a

[Haskell-cafe] A Random Question

2007-12-15 Thread Dominic Steinitz
What do you need, i.e., what meaning do you attribute to the words predictable and arbitrary? Apologies - I didn't explain my problem clearly. I want to say something like: instance Arbitrary Foo where arbitrary = choose (Foo 1, Foo 5) but the random values are generated by my own

Re: [Haskell-cafe] A Random Question

2007-12-15 Thread Dominic Steinitz
Paul Johnson wrote: Dominic Steinitz wrote: Unfortunately for your purpose you would need: *generate* :: (RandomGen g) = Int http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Int.html#t%3AInt - g - Gen http://www.haskell.org/ghc/docs/latest/html/libraries/QuickCheck/Test

Re: [Haskell-cafe] Questions about the Functor class and it's use in Data types à la carte

2007-12-16 Thread Dominic Steinitz
keep in mind that Haskell composition (.) is not really composition in the category-theoretic sense, because it adds extra laziness. Use this Do you have a counter-example of (.) not being function composition in the categorical sense? ___

Re: [Haskell-cafe] Questions about the Functor class and it's use in Data types à la carte

2007-12-16 Thread Dominic Steinitz
Do you have a counter-example of (.) not being function composition in the categorical sense? Let bot be the function defined by bot :: alpha - beta bot = bot By definition, (.) = \ f - \ g - \ x - f (g x) Then bot . id = ((\ f - \ g - \ x - f (g x)) bot) id = (\ g - \ x

Re: [Haskell-cafe] Questions about the Functor class and it's use in Data types à la carte

2007-12-16 Thread Dominic Steinitz
Roberto Zunino wrote: Dominic Steinitz wrote: This would give = \x - bot x and by eta reduction This is the point: eta does not hold if seq exists. undefined `seq` 1 == undefined (\x - undefined x) `seq` 1 == 1 Ok I've never used seq and I've never used unsavePerformIO

Re: [Haskell-cafe] Questions about the Functor class and it's use in Data types à la carte

2007-12-16 Thread Dominic Steinitz
Jonathan Cast wrote: On 16 Dec 2007, at 3:21 AM, Dominic Steinitz wrote: Do you have a counter-example of (.) not being function composition in the categorical sense? Let bot be the function defined by bot :: alpha - beta bot = bot By definition, (.) = \ f - \ g - \ x - f (g x

[Haskell-cafe] Foldable Rose Trees

2007-12-18 Thread Dominic Steinitz
I've been trying to re-label nodes in a rose tree without re-inventing wheels (although I'm beginning to wish I had). I've got as far as this but haven't yet cracked the general case for Traversable. Any help would be much appreciated. Thanks, Dominic. *Main let (p,_) = runState (unwrapMonad

[Haskell-cafe] Re: Foldable Rose Trees

2007-12-18 Thread Dominic Steinitz
Solution 1) Data.Tree is already an instance of Traversable. :) Yes it's all there but I would have missed the fun of trying to do it myself ;-) Plus the data structure I actually want to re-label isn't quite a rose tree. Solution 2) The key observation is that you the instances for rose

[Haskell-cafe] Re: Basic question concerning the category Hask (was: concerning data constructors)

2008-01-06 Thread Dominic Steinitz
Jonathan Cast jonathanccast at fastmail.fm writes: Extensionality is a key part of the definition of all of these constructions. The categorical rules are designed to require, in concrete categories, that the range of the two injections into a coproduct form a partition of the

[Haskell-cafe] Re: ANN: A triple of new packages for talking to the outside world

2008-01-09 Thread Dominic Steinitz
Adam Langley agl at imperialviolet.org writes: But if this is useful to you, make any requests. I'll (hopefully) do them, clean it up and push a new release of binary-strict. How difficult would it be to have a getBits functions as well as a getBytes? That would allow me drop the dependency

[Haskell-cafe] Re: ANN: A triple of new packages for talking tothe outside world

2008-01-09 Thread Dominic Steinitz
Duncan Coutts duncan.coutts at worc.ox.ac.uk writes: On Wed, 2008-01-09 at 09:26 +, Dominic Steinitz wrote: Adam Langley agl at imperialviolet.org writes: But if this is useful to you, make any requests. I'll (hopefully) do them, clean it up and push a new release of binary

[Haskell-cafe] ANN: Haskell Cryptographic Library 4.1.0

2008-01-12 Thread Dominic Steinitz
I'd like to announce the release of a new version of the library following various contributions (contributors are bcc'd). Additions include: BubbleBabble, TEA, HMAC and more large word support. It no longer includes Base64. This is provided by

[Haskell-cafe] Haddock Problem

2010-06-14 Thread Dominic Steinitz
..\ThirdParty\Haskell_Platform\2010.1.0.0\bin\haddock.exe BackendC\Core.hs haddock.exe: can't find a package database at E:\ghc\ghc-6.12.1lib\package.conf.d But if I do haddock --help there is no option to set the package database and I don't even have an E: drive. I'm on windows in case that

[Haskell-cafe] Re: Haddock Problem

2010-06-14 Thread Dominic Steinitz
Try --optghc=-package-conf --optghc=file, to point Haddock at the custom DB. Hi David, Thanks for the quick response. No dice I am afraid. Dominic. BTW this (using optghc) used to work on previous versions of haddock (iirc 2.4 and 2.5).

[Haskell-cafe] Re: Haddock Problem

2010-06-14 Thread Dominic Steinitz
David Waern david.waern at gmail.com writes: 2010/6/14 David Waern david.waern at gmail.com: OK, it seems like the path from the ghc-paths package overrided what you specified. I'm not sure this will work, but you could try:  haddock -B

[Haskell-cafe] Re: Haddock Problem

2010-06-15 Thread Dominic Steinitz
David Waern david.waern at gmail.com writes: I think using --optghc=-package-conf is the correct way to point to another package DB, so I'll look into why it doesn't work. Perhaps another line of attack would be to see why haddock thinks I have an E: drive?

[Haskell-cafe] Re: Haddock Problem

2010-06-22 Thread Dominic Steinitz
malcolm.wallace malcolm.wallace at me.com writes: I haven't been following closely, but how did you install haddock? From a binary dist? Is it possible that one of the Windows binary dists has a baked-in location for something on the E: drive, which existed on the packager's machine but

[Haskell-cafe] Re: Haddock Problem

2010-06-24 Thread Dominic Steinitz
Does anyone have any suggestions or do I have to start building haddock myself? Ok I built it from source rather than using the Haskell Platform exe and it now works. Perhaps the packager of the Haskell Platform for Windows could take a look at why the binary is behaving as it does? Dominic.

[Haskell-cafe] Lazy ByteString Problem

2007-01-28 Thread Dominic Steinitz
I've been playing around with streams as a way of implementing cryptographic functions as they seem to allow you to write code that reads more like the specification. However, I believe (and profiling seems to confirm this) that this builds up a large expression which only gets evaluated at

[Haskell-cafe] Re: Lazy ByteString Problem

2007-01-28 Thread Dominic Steinitz
On Sunday 28 January 2007 15:01, Dominic Steinitz wrote: I've been playing around with streams as a way of implementing cryptographic functions as they seem to allow you to write code that reads more like the specification. However, I believe (and profiling seems to confirm

[Haskell-cafe] Space Leak Help

2007-02-03 Thread Dominic Steinitz
I have re-written SHA1 so that is more idiomatically haskell and it is easy to see how it implements the specification. The only problem is I now have a space leak. I can see where the leak is but I'm less sure what to do about getting rid of it. Here's the offending function: pad :: [Word8]

Re: [Haskell-cafe] Space Leak Help

2007-02-04 Thread Dominic Steinitz
On Saturday 03 February 2007 19:56, Pepe Iborra wrote: pad :: [Word8] - [Word8] pad xs = pad' xs 0 pad' (x:xs) l = x : pad' xs (succ l) pad' [] l = [0x80] ++ ps ++ lb     where        pl = (64-(l+9)) `mod` 64        ps = replicate pl 0x00        lb = i2osp 8 (8*l) Pepe, Thanks but this

Re: [Haskell-cafe] Space Leak Help

2007-02-04 Thread Dominic Steinitz
On Saturday 03 February 2007 19:42, [EMAIL PROTECTED] wrote: I have re-written SHA1 so that is more idiomatically haskell and it is easy to see how it implements the specification. The only problem is I now have a space leak. I can see where the leak is but I'm less sure what to do

Re: [Haskell-cafe] Space Leak Help

2007-02-04 Thread Dominic Steinitz
On Sunday 04 February 2007 08:28, Stefan O'Rear wrote: On Sun, Feb 04, 2007 at 08:20:23AM +, Dominic Steinitz wrote: Someone suggested pad :: Num a = [a] - [a] pad = pad' 0 where pad' !l [] = [0x80] ++ ps ++ lb where pl = (64-(l+9)) `mod` 64 ps

[Haskell-cafe] Re: Space Leak Help

2007-02-04 Thread Dominic Steinitz
If anyone wants to play with this, here's a version of the leak that doesn't need any libraries or extensions. pad causes a stack overflow and pad1 uses up about 6m of heap. Dominic. module Main(main) where import Data.Word import Data.Bits import Data.List pad = pad' 0 where pad' l [] =

[Haskell-cafe] Another Space Leak

2007-02-04 Thread Dominic Steinitz
Many thanks for the help on the original space leak which is now fixed -see the function pad below and test runs in small constant space. However, that has merely revealed the next space leak. The problem appears to be blockWord8sIn512 :: [Word8] - [[Word8]] blockWord8sIn512 = unfoldr g

[Haskell-cafe] Re: ANN: A triple of new packages for talking tothe outside world

2008-01-16 Thread Dominic Steinitz
Adam Langley agl at imperialviolet.org writes: On Jan 10, 2008 10:45 AM, Don Stewart dons at galois.com wrote: That's pretty much what we envisaged as the approach to take. Monad transformers adding some bit-buffer state over Get/Put. For anyone who's still reading this thread...

[Haskell-cafe] Re: ANN: A triple of new packages for talking tothe outside world

2008-01-17 Thread Dominic Steinitz
Adam Langley agl at imperialviolet.org writes: BitGet is just an API RFC at the moment, so I'm just describing it here - not trying to justify it. In BitGet there's getAsWord[8|16|32|64] which take a number of bits ($n$) and returns the next $n$ bits in the bottom of a Word$x$. Thus,

[Haskell-cafe] Re: anybody can tell me the pronuncation of

2008-01-29 Thread Dominic Steinitz
I didn't know Haskell was an English name. There's a Haskell playing for England at Twickenham on Saturday. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Implementing fixed-sized vectors (using datatype algebra?)

2008-01-31 Thread Dominic Steinitz
Look at http://sneezy.cs.nott.ac.uk/fun/feb-07/jeremy-slides.pdf and http://article.gmane.org/gmane.comp.lang.haskell.cafe/27062 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Broken http://darcs.haskell.org/darcsweb/?

2008-02-20 Thread Dominic Steinitz
I'm getting errors when I click on any of the links. I'm not sure who administers the site. IOError Python 2.4.4: /usr/bin/python Wed Feb 20 11:41:13 2008 A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

[Haskell-cafe] Re: Graphical graph reduction

2008-02-23 Thread Dominic Steinitz
About 7 years ago such a tool existed: http://www.cs.kent.ac.uk/people/staff/cr3/toolbox/haskell/GHood/ I don't know if Claus is around. Perhaps he could give you more information. Dominic. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: Functional programmer's intuition for adjunctions?

2008-03-04 Thread Dominic Steinitz
Well, we have at least one very useful example of adjunction. It's called curry. See, if X is some arbitrary type, you can define This adjunction is the one that makes a category cartesian closed. Dominic. ___ Haskell-Cafe mailing list

[Haskell-cafe] Opening Windows .lnk Files

2008-03-22 Thread Dominic Steinitz
Does anyone know how to do this? If I open a file on Windows e.g. asn_application.h.lnk then I get the link data rather than the data in the linked file. Thanks, Dominic. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Opening Windows .lnk Files

2008-03-22 Thread Dominic Steinitz
Neil Mitchell wrote: Hi Drop into the command line, rename the file from foo.lnk to foo.txt, using ren foo.lnk foo.txt, then open foo.txt. It's a chunk of binary goop, so will likely not be much use. There is a COM class for editing shortcut files (IShellLink), which I've used before from C

[Haskell-cafe] Haddock Help Required

2008-03-24 Thread Dominic Steinitz
What should I be using for the file name for the read-interface option in haddock? Trying to use the file on www.haskell.org gives this: [EMAIL PROTECTED]:~/asn15/asn1 haddock -html -o hdoc Pretty.hs -B /usr/lib/ghc-6.8.2 --optghc=-fglasgow-exts

[Haskell-cafe] Re: Haddock Help Required

2008-03-29 Thread Dominic Steinitz
David Waern david.waern at gmail.com writes: 2008/3/24, Dominic Steinitz dominic.steinitz at blueyonder.co.uk: What should I be using for the file name for the read-interface option in haddock? You must use a file that is on your own hard drive and that is generated with version 2.0

[Haskell-cafe] Re: Couple of formal questions

2008-05-12 Thread Dominic Steinitz
Creighton Hogg wchogg at gmail.com writes: between well-founded recursion well-founded(?) corecursion?Where could I find a proof that the initial algebras final coalgebras of CPO coincide?  I Creighton, I started putting something together here. I'm not sure if it's what you are after and

[Haskell-cafe] Re: Couple of formal questions

2008-05-17 Thread Dominic Steinitz
Creighton Hogg wchogg at gmail.com writes: Where could I find a proof that the initial algebras final coalgebras of CPO coincide? I saw this referenced in the Bananas.. paper as a fact, but am not sure where this comes from Creighton, As promised and I hope this is what you were after.

[Haskell-cafe] Mersenne Build Problem

2008-06-07 Thread Dominic Steinitz
I'm getting errors (see below) trying to build the tests in http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mersenne-random-0.1.1 I built the package itself using ./Setup configure -f use_sse2 I thought I had an intel core duo (also see below). I think I may be missing a library but

[Haskell-cafe] Re: Mersenne Build Problem

2008-06-08 Thread Dominic Steinitz
Bertram Felgenhauer bertram.felgenhauer at googlemail.com writes: The missing symbols are inlined functions. ghc 6.9 doesn't include the header files anymore when compiling via C. (The solution is to create C wrappers around those functions. I guess I'll whip up a patch.) Bertram,

[Haskell-cafe] Re: Compiling large code with old machine

2008-06-18 Thread Dominic Steinitz
Samuel Silva silva.samuel at gmail.com writes: Hello I'm using GHC to compile around 700K of Haskell Code generated by HaXml. How I compile this code. My machine is Windows-XP(512MB RAM, 1.5GHz) running GHC-6.8.2. Samuel, You may not want to take this approach. I'm assuming you are

[Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Dominic Steinitz
OK, so today I tried to write my first program using the Binary library. And I've hit a snag: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses three bytes, not three bits. Before I sit down and spend 3 months designing my own

Re: [Haskell-cafe] Re: Bit Streams

2008-06-18 Thread Dominic Steinitz
Don Stewart wrote: dominic.steinitz: OK, so today I tried to write my first program using the Binary library. And I've hit a snag: It appears the library will only handle data that is byte-aligned. So if I try to write three Bool values, it uses three bytes, not three bits. Before I sit

[Haskell-cafe] Swapping Monads

2008-07-07 Thread Dominic Steinitz
I have a solution so this is for interest only. It is not normally the case that two monads compose to give another monad. Monad transformers capture when this is possible. However, when there is a swap function satisfying some commutative diagrams then it can be proved that the monads compose

[Haskell-cafe] haskell-src-exts Question

2009-11-13 Thread Dominic Steinitz
I've been generating Haskell using haskell-src-exts but the prettyprinter isn't producing what I would expect. I would expect parse . prettyPrint == id i.e. the AST should be unchanged if you prettyprint it then parse it. Here's an example generated expression: App (App (Var (UnQual (Ident

[Haskell-cafe] Re: haskell-src-exts Question

2009-11-16 Thread Dominic Steinitz
Niklas Broberg niklas.broberg at gmail.com writes: please? http://trac.haskell.org/haskell-src-exts Niklas, I'd love to raise a bug for it but unfortunately I can't log on to trac. I don't understand why but none of my colleagues can log on either. It's been a long standing issue. I presume

[Haskell-cafe] Re: haskell-src-exts Question

2009-11-16 Thread Dominic Steinitz
Dominic Steinitz dominic at steinitz.org writes: Niklas Broberg niklas.broberg at gmail.com writes: please? http://trac.haskell.org/haskell-src-exts Niklas, I'd love to raise a bug for it but unfortunately I can't log on to Good news. Although I couldn't logon as guest, I've created

[Haskell-cafe] ForSyDe (parameterized-data) fails to build

2009-12-15 Thread Dominic Steinitz
I'm not sure how actively this is maintained or used but I couldn't get it to build. Downloading parameterized-data-0.1.3... Configuring parameterized-data-0.1.3... Preprocessing library parameterized-data-0.1.3... Building parameterized-data-0.1.3... src\Data\Param\FSVec.hs:1:46: Warning:

[Haskell-cafe] Re: (liftM join .) . mapM

2009-12-29 Thread Dominic Steinitz
Stephen Tetley stephen.tetley at gmail.com writes: -- | Compose an arity 1 function with an arity 2 function. -- B1 - blackbird oo :: (c - d) - (a - b - c) - a - b - d oo f g = (f .) . g Extending the arity works quite nicely too: -- | Compose an arity 1 function with an arity 3

[Haskell-cafe] Re: Category Theory woes

2010-02-02 Thread Dominic Steinitz
Mark Spezzano mark.spezzano at chariot.net.au writes: Maybe there are books on Discrete maths or Algebra or Set Theory that deal more with Hom Sets and Hom Functions? Googling haskell category theory I got: http://en.wikibooks.org/wiki/Haskell/Category_theory

[Haskell-cafe] Re: Linguistic hair-splitting

2010-02-15 Thread Dominic Steinitz
wren ng thornton wren at freegeek.org writes: or whatever). Haskell and similar languages choose a particular set of coercions to Nice explanation. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Random State Monad and Stochastics

2005-05-02 Thread Dominic Steinitz
I don't think they are in the standard libraries but there was some discussion about them a few months ago but I couldn't find a reference. Peter, Can you supply one? I think you were a participant in the discussion. Did you put a library of this sort of thing together? Here's my tuppenceworth

[Haskell-cafe] binary IO

2005-12-27 Thread Dominic Steinitz
It might also be worth looking at the networking code in House given the intended application is parsing network packets. See http://www.cse.ogi.edu/~hallgren/House/kernel/pfe.cgi?Net.PacketParsing, for example. Dominic. ___ Haskell-Cafe mailing

[Haskell-cafe] Typechecking Help

2006-01-02 Thread Dominic Steinitz
I have a function which, without a type annotation, types as: *Codec.ASN1.BER :t choiceAux choiceAux :: forall (m :: * - *) e e1. (MonadState [Maybe Encoding] m, MonadState [Maybe Encoding] (StateT [Maybe Encoding] m), MonadError e (StateT [Maybe Encoding]

Re: [Haskell-cafe] Typechecking Help

2006-01-02 Thread Dominic Steinitz
On Monday 02 Jan 2006 9:52 am, Joel Reymont wrote: I had this exact same issue when I swapped e and e1 by mistake. Does your code work right without the type signature or does it just compile? It seems to work ok. I am able to parse an attribute certificate generated by a different (java)

[Haskell-cafe] Project postmortem II /Haskell vs. Erlang/

2006-01-02 Thread Dominic Steinitz
I'd like to second Joel's comments on records very strongly. In an application where you need lots of big records (such as supporting X.509), you end up with very unnatural names for components. It works but it's not pretty. Dominic. ___ Haskell-Cafe

Re: [Haskell-cafe] Typechecking Help

2006-01-02 Thread Dominic Steinitz
On Monday 02 Jan 2006 10:59 am, Bulat Ziganshin wrote: Hello Dominic, Monday, January 02, 2006, 11:59:53 AM, you wrote: *Codec.ASN1.BER :t choiceAux DS choiceAux :: forall (m :: * - *) e e1. DS (MonadState [Maybe Encoding] m, DS MonadState [Maybe Encoding]

[Haskell-cafe] Re: Haskell code for this example of flow control

2006-02-04 Thread Dominic Steinitz
Here are some even older discussions on the subject. I don't know if anyone ever put them into a library or on the wiki. Dominic. http://haskell.org/pipermail/haskell-cafe/2005-May/009784.html http://www.haskell.org//pipermail/libraries/2005-February/003143.html

[Haskell-cafe] Digrams

2006-02-11 Thread Dominic Steinitz
I've quickly put this together to measure frequencies of pairs of letters (e.g. 1st and 2nd) in words. It works fine on a small test data sets but I have a feeling that it will perform poorly as it spends a lot of time updating a 26*26 array. Before I throw a dictionary at it, does anyone have

Re: [Haskell-cafe] Digrams

2006-02-11 Thread Dominic Steinitz
On Saturday 11 Feb 2006 1:09 pm, Jon Fairbairn wrote: On 2006-02-11 at 12:25GMT Dominic Steinitz wrote: I've quickly put this together to measure frequencies of pairs of letters (e.g. 1st and 2nd) in words. It works fine on a small test data sets but I have a feeling that it will perform

[Haskell-cafe] Re: Returning a list element?

2006-03-21 Thread Dominic Steinitz
Robert Dockins robdockins at fastmail.fm writes: FYI, putStrLn will automatically insert a newline for you, and the final 'return ()' is unnecessary. My favorite idiom for this kind of thing is: mainMenu = putStr $ unlines [ line 1 , line 2 , line 3 ] Or how about

[Haskell-cafe] Re: Returning a list element?

2006-03-22 Thread Dominic Steinitz
Donald Bruce Stewart dons at cse.unsw.edu.au writes: mainMenu = sequence_ $ map putStrLn [line1, line2, line3] I argue if you want to sequence_ a map you should write mapM_: mapM_ putStrLn [line1, line2, line3] Nice mapM is under-appreciated? More under-appreciated are line

[Haskell-cafe] QuickCheck Fun with Phantom Types

2006-05-13 Thread Dominic Steinitz
I was doing Exercise 5 of Ralf's Fun with Phantom Types and naturally thought I'd check my solution with QuickCheck. The best I could was this. Is there something better? Can you somehow generate random types as well as random values in those types? Thanks, Dominic. PS the full source for my

[Haskell-cafe] Re: QuickCheck Fun with Phantom Types

2006-05-22 Thread Dominic Steinitz
Since Don was kind enough to include my question in HWN (http://www.cse.unsw.edu.au/~dons/code/hwn/archives/20060522.html) and I have now come up with a solution, I have created a wiki page (http://haskell.org/haskellwiki/QuickCheck_/_GADT) with it in. Dominic.

[Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-29 Thread Dominic Steinitz
Brian Hulley wrote: Hi Dominic - I hope it's ok for me to ask this question and I'm absolutely burning with curiosity to find out the answer... How did you know to write ((.).(.)) instead of (\f g a b - f (g a b)) ? Brian, I can't remember. I certainly don't find it intuitive. I think it

[Haskell-cafe] Re: Codec.Crypto.RSA question

2010-11-20 Thread Dominic Steinitz
Charles-Pierre Astolfi cpa at crans.org writes: Hi -cafe, I have a question about Codec.Crypto.RSA: how to enforce that (informally) decrypt . encrypt = id Consider this code: That's certainly what I would expect and one of the unit tests that comes with

[Haskell-cafe] Problems with Haskell Program Coverage

2009-04-22 Thread Dominic Steinitz
I want to use hpc to check that the ASN.1 library tests cover all the code. When I run it with a set of tests that I *know* don't test certain things, it reports that they have been covered i.e. there are not coloured in the markup that hpc produces. I would have expected a lot of yellow. It

[Haskell-cafe] Re: Problems with Haskell Program Coverage

2009-04-25 Thread Dominic Steinitz
Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk writes: Dominic Steinitz dominic.steinitz at blueyonder.co.uk wrote: I want to use hpc to check that the ASN.1 library tests cover all the code. When I run it with a set of tests that I *know* don't test certain things, it reports

[Haskell-cafe] Cabal, Time GHC 6.10.2

2009-05-17 Thread Dominic Steinitz
The Glorious Glasgow Haskell Compilation System, version 6.10.2 d...@linux-6ofq:~/asn1 ghc-pkg --version GHC package manager version 6.10.2 Here's my .cabal file. Name:PER Version: 0.0.20 License: BSD3 Author: Dominic Steinitz Maintainer: dominic.stein

Re: [Haskell-cafe] Cabal, Time GHC 6.10.2

2009-05-24 Thread Dominic Steinitz
Duncan Coutts wrote: On Sun, 2009-05-17 at 09:17 +0100, Dominic Steinitz wrote: I get d...@linux-6ofq:~/asn1 runghc Setup.hs configure Configuring PER-0.0.20... Setup.hs: At least the following dependencies are missing: time -any -any but I have time d...@linux-6ofq:~/asn1 ghc-pkg list

[Haskell-cafe] HPC Website FAQ

2009-05-24 Thread Dominic Steinitz
There's a nice website for HPC but it looks a bit out of date. http://projects.unsafeperformio.com/hpc/ I wanted to send a patch to the FAQ for using HPC with .lhs files (you have to run ghc -E to generate .hs files and strip some of the the lines ghc generates: {-# LINE 1 ASNTYPE.lhs #-} #line

[Haskell-cafe] Re: Haddock : parse error on input `{-# UNPACK'

2009-06-06 Thread Dominic Steinitz
Erik de Castro Lopo mle+hs at mega-nerd.com writes: src/Data/Binary/Strict/IncrementalGet.hs:106:11: parse error on input `{-# UNPACK' Is this a bug? Is there any way to work around it? This is a haddock error and I presume a bug in haddock. I don't know whether cabal installs

[Haskell-cafe] Re: Haddock : parse error on input `{-# UNPACK'

2009-06-07 Thread Dominic Steinitz
Erik de Castro Lopo mle+hs at mega-nerd.com writes: Dominic Steinitz wrote: Erik de Castro Lopo mle+hs at mega-nerd.com writes: src/Data/Binary/Strict/IncrementalGet.hs:106:11: parse error on input `{-# UNPACK' This is a haddock error and I presume a bug

[Haskell-cafe] Re: Haddock : parse error on input `{-# UNPACK'

2009-06-07 Thread Dominic Steinitz
Dominic Steinitz dominic at steinitz.org writes: Erik de Castro Lopo mle+hs at mega-nerd.com writes: Dominic Steinitz wrote: Erik de Castro Lopo mle+hs at mega-nerd.com writes: src/Data/Binary/Strict/IncrementalGet.hs:106:11: parse error on input

[Haskell-cafe] Re: Best book/tutorial on category theory and its applications

2008-07-31 Thread Dominic Steinitz
fero frantisek.kocun at gmail.com writes: What do you think about Categories and Computer Science (Cambridge Computer Science Texts) at http://www.amazon.com/Categories-Computer-Science-Cambridge- Texts/dp/0521422264/ref=si3_rdr_bb_product ? I couldn't see monads or the Yoneda lemma in

[Haskell-cafe] Re: control-timeout with gtk

2008-09-18 Thread Dominic Steinitz
Adam Langley agl at imperialviolet.org writes: be removed. Anyone who wants to maintain any of them should grab it now. The repos are all at http://darcs.imperialviolet.org On the chopping block: binary-strict Adam, I don't particularly want to maintain this as I have negative amounts

[Haskell-cafe] Re: Health effects

2008-10-01 Thread Dominic Steinitz
Adrian Neumann aneumann at inf.fu-berlin.de writes: I often wonder how many cuts you need to divide a steak in n pieces. You can obviously get n pieces with (sqrt n) cuts by cutting a grid. But I'm sure some smart mathematician thought of a (log n) way. You might try the ham sandwich

[Haskell-cafe] Darcs / Git

2008-10-06 Thread Dominic Steinitz
Not really a Haskell question but I'm not sure where else to go. What's the preferred method of converting a darcs repository to git? And is there a way of converting from git to darcs? The reason I ask is that my colleague cannot get darcs to work on his Windows box. Thanks, Dominic.

[Haskell-cafe] Re: Problems with strictness analysis?

2008-11-04 Thread Dominic Steinitz
wren ng thornton wren at freegeek.org writes: [snick] isum 0 s = s isum n s = isum (n-1) (s+n) This is tail recursive, and will be optimized to an iterative loop; [snick] In terms of having a compiler 'smart enough', it's not clear that functions of this sort ought to be inferred

[Haskell-cafe] Exporting a Type Class for Type Signatures

2008-11-10 Thread Dominic Steinitz
In the crypto package, I have two functions encrypt :: AESKey a = a - Word128 - Word128 decrypt :: AESKey a = a - Word128 - Word128 which are exported. I also have class (Bits a, Integral a) = AESKey a instance AESKey Word128 instance AESKey Word192 instance AESKey Word256 unexported

[Haskell-cafe] Need machine for DPH benchmarking

2008-11-27 Thread Dominic Steinitz
we, the DPH team, are at the moment in the very unfortunate situation of not having a proper machine for running our benchmarks on. Could a kind soul maybe give us (i.e., me) access to a quadcore or 2xquadcore x86 Linux or OS X machine? I only need to build ghc on it and run small

[Haskell-cafe] Building QuickCheck 2 Under GHC 6.10.1

2008-11-27 Thread Dominic Steinitz
Having been a happy user of QuickCheck 2 for many years, I now find it won't build under ghc 6.10.1. Before I investigate further, has anyone encountered this problem and has a fix? Thanks, Dominic. C:\Users\Dom\QuickCheckSetup build Preprocessing library QuickCheck-2.0... Building

Re: pbkdf2 on hackage Re: Re[2]: [Haskell-cafe] Password hashing

2008-11-28 Thread Dominic Steinitz
Thomas Hartman wrote: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/PBKDF2 Since no one took up my code review request I just did the best I could and uploaded to hackage. There were indeed some mistakes in my initial post, fixed now. (Code review is still wished, though!)

[Haskell-cafe] Control.Exception Funny

2008-11-29 Thread Dominic Steinitz
I'm probably doing something wrong but this example doesn't compile for me under ghc 6.10.1 (http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#4): catch (openFile f ReadMode) (\e - hPutStr stderr (Couldn't open ++f++: ++ show e)) Run.hs:77:24:

Re: [Haskell-cafe] Control.Exception Funny

2008-11-29 Thread Dominic Steinitz
Claus Reinke wrote: btw, if your handler cannot return the same type as your action, is this the right place to catch the exceptions? That was an example, the real code looks something like this: do d - getCurrentDirectory t - getCurrentTime let u = asn1c. ++ show (utctDay

Re: pbkdf2 on hackage Re: Re[2]: [Haskell-cafe] Password hashing

2008-12-07 Thread Dominic Steinitz
Thomas Hartman wrote: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/PBKDF2 Since no one took up my code review request I just did the best I Also I'm open to folding this into a more established crypto package if there are any takers... psst, dominic. I've now had chance to

(Off-topic) Question about categories

2003-09-27 Thread Dominic Steinitz
Graham, I'm not sure if anyone mentioned the examples of a poset and a monoid as categories. There is no internal structure in these. In the former, the objects are the elements and there is a morphism between a and b iff a = b. A functor then becomes an order preserving map. In the latter, there

[Haskell-cafe] Interpreting fields in a buffer

2004-01-27 Thread Dominic Steinitz
I looked at the Erlang syntax when I wrote my helper functions and I agree it is very nifty. I didn't have the time to investigate how to do it in Haskell but it would be disappointing if it (or something like it) couldn't be done. Dominic. Mikael, Thanks, that's very helpful and seems to be

  1   2   >