From oleg at pobox.com Thu Mar 1 02:56:47 2007 From: oleg at pobox.com (oleg@pobox.com) Date: Thu Mar 1 02:51:08 2007 Subject: [Haskell] Haskell with only one typeclass Message-ID: <20070301075647.3CCFAAD34@Adric.metnet.fnmoc.navy.mil> Defining new typeclasses is regarded as an important part of Haskell programming, as the normal way of introducing overloaded functions. This message shows that if the ability to define typeclasses is removed, no expressivity is lost. If Haskell had only one, pre-defined typeclass with only one method, we could still do normal Haskell programming with standard and user-defined overloaded numerical functions, monads, monad transformers, etc. Haskell with only one typeclass can express all of Haskell98 typeclass programming idioms including constructor classes, plus multi-parameter type classes and some functional dependencies. If we additionally admit TypeCast as a pre-defined constraint, the rest of functional dependencies are expressible. Besides clarifying the role of typeclasses in Haskell as method bundles, this message proposes a model of overloading resolution that is simpler than that of Hall et al. Perhaps this model might be of interest to Haskell' committee. The present approach is inspired by HList's class Apply, which seems to be, after a small adjustment, the universal class. For clarity of terminology, we call as Haskell1 the language Haskell98 with no typeclass declarations but with a single, already declared typeclass C (which has two parameters related by a functional dependency). The programmers may not declare any typeclasses; but they may add instances to C and use them. We show on a series of examples that despite the lack of typeclass declarations, Haskell1 can express all the typeclass code of Haskell98 and then multi-parameter type classes and some (most useful?) functional dependencies. Haskell98 methods are defined as ordinary functions in Haskell1. To represent the rest of functional dependencies, we later define Haskell1' as an extension of Haskell1 with a pre-defined constraint TypeCast (which is not user-extensible and can be considered built-in). Finally we introduce the analogue of Haskell98 classes -- method bundles -- and use them for defining bounded existentials. Obviously Haskell1 is merely a subset of Haskell rather than a new language; the removal of typeclass declarations is a matter of discipline rather than that of syntax. We offer a model of overloading resolution that is a bit different from that of Stuckey and Sulzmann's `A theory of overloading.' When an instance is selected, its dependent arguments are improved (`typecast'). If an instance is not selected, no type improvement is applied. Granted, this model is not formalized. But then, this message is not an ICFP paper. The complete code described in this message is available at http://pobox.com/~oleg/ftp/Haskell/Haskell1/Class1.hs http://pobox.com/~oleg/ftp/Haskell/Haskell1/Class2.hs We first disclose our one and only type class: > class C l t | l -> t where ac :: l -> t The constraint C is pervasive, which makes some signatures in want of syntax sugar, which we purposely avoid for clarity. We start by building overloaded numeric functions, the analogue of Num. The following defines the functions `a la carte'. Later we shall see how to bundle them into what Haskell98 calls `classes'. We begin with addition, to be denoted (+$) to avoid the confusion with the Prelude. > data Add a > infixl 6 +$ > (+$) :: forall a. C (Add a) (a->a->a) => a -> a -> a > (+$) = ac (__:: Add a) Whereas (+) in Haskell was a method, here the overloaded addition is a regular function, albeit bounded polymorphic. As we shall see, the constraints of such functions are analogues of Haskell98 class constraints. The above signature, sans the constraint, is the same as that of Prelude.(+). We will see later a way to avoid writing the C constraint explicitly. Let's define the instances of the generic addition for Ints and Floats > instance C (Add Int) (Int->Int->Int) where ac _ x y = x + y > instance C (Add Float) (Float->Float->Float) where ac _ x y = x + y as well over Dual numbers > data Dual a = Dual a a deriving Show > instance C (Add a) (a->a->a)=>C (Add (Dual a)) (Dual a->Dual a->Dual a) where > ac _ (Dual x1 y1) (Dual x2 y2) = Dual (x1 +$ x2) (y1 +$ y2) The latter is defined inductively, with the addition over base types being the base case. > ta2 = let x = Dual (1::Int) 2 in x +$ x -- sample test Likewise, we define the overloaded multiplication. This time, we use partial signatures to avoid writing the C constraint: > infixl 7 *$ > mul_sig :: a -> a -> a; mul_sig = undefined > mul_as :: a -> Mul a; mul_as = undefined > x *$ y | False = mul_sig x y > x *$ y = ac (mul_as x) x y Functions frmInteger and shw are analogous. As in Haskell98, we use the available overloaded functions to define new generic functions. For example, > genf x = x *$ x *$ (frmInteger 2) > tm1 = genf (Dual (1::Float) 2) +$ (frmInteger 3) The complete code demonstrates the overloading of not only functions but also of plain values: minBound. Next we turn to constructor classes and Monads, which can be easily restricted as frequently desired. > data RET (m :: * -> *) a > data BIND (m :: * -> *) a b > ret :: forall m a. C (RET m a) (a->m a) => a -> m a > ret = ac (__::RET m a) > bind :: forall m a b. C (BIND m a b) (m a->(a -> m b)->m b) => > (m a->(a -> m b)->m b) > bind = ac (__::BIND m a b) We show one particular monad: Either e > instance C (RET (Either e) a) (a -> Either e a) where ac _ = Right > instance C (BIND (Either e) a b) > (Either e a -> (a->Either e b) -> Either e b) where > ac _ (Right x) f = f x > ac _ (Left x) f = Left x with the goal to demonstrate MonadError, which is defined in Haskell's monad transformer library as follows -- class Error a where -- strMsg :: String -> a -- class Monad m => MonadError e m | m -> e where -- throwError :: e -> m a -- catchError :: m a -> (e -> m a) -> m a In Haskell1, the above code becomes > data ERROR a > strMsg :: forall a. C (ERROR a) (String->a) => String -> a > strMsg = ac (__::ERROR a) > instance C (ERROR String) (String->String) where ac _ = id > data ThrowError (m :: * -> *) a > throwError :: forall e m a b t1 t2. > (C (ThrowError m a) (e -> m a), C (RET m a) t1, C (BIND m a b) t2) => > e -> m a > throwError = ac (__::ThrowError m a) Here the constraints C (RET m a) t1 and C (BIND m a b) t2 are not called for, but we specified them anyway. That is, we require that `m' be an instance of a Monad. These extra constraints are Haskell1 analogue of Haskell's `class constraints'. The definition of catchError is similar. The Either e monad is an instance of MonadError > instance C (ThrowError (Either e) a) (e -> Either e a) where ac _ = Left > instance C (CatchError (Either e) a) > (Either e a -> (e -> Either e a) -> Either e a) where > ac _ (Left x) f = f x; ac _ x _ = x so we can write a test > te1 x = runEither $ catchError ac (\e -> ret e) > where > ac = (if x then throwError "er" else ret (2::Int)) `bind` > (\x -> ret (x *$ x)) `bind` (ret.shw) > runEither :: Either a b -> Either a b; runEither = id > te1r = (te1 True, te1 False) The MonadError example demonstrated that we already have some functional dependencies. To get them in full, we extend Haskell1 with the ``pre-defined'' constraint TypeCast. For example, to express the following Haskell method of two arguments with the type of the first argument determining the types of the result and of the second argument -- class FC3 a b c | a -> b c where fc3 :: a -> b -> c -- instance FC3 Bool Char Int we write in Haskell1' > data FC3 a b c > fc3 :: forall a b c. C (FC3 a b c) (a->b->c) => a->b->c > fc3 = ac (__::FC3 a b c) > instance TypeCast (FC3 Bool b c) (FC3 Bool Char Int) > => C (FC3 Bool b c) (Bool->Char->Int) where ac _ x y = 1 > tfc3 = fc3 True 'a' > tfc31 = fc3 True undefined The latter two sample definitions are accepted as they are. Without the functional dependencies, however, we would have needed type annotations. The accompanying complete code has the expanded example. Finally, we introduce the analogue of Haskell98 `classes' -- bundles of methods -- whose compelling application is bounded existentials. Let's define the Num bundle and numeric functions that are truly NUM-overloaded > data NUM a = NUM{nm_add,nm_mul :: a->a->a, > nm_fromInteger :: Integer->a, nm_show :: a->String} > data CLS a > instance (C (Add a) (a->a->a), C (Mul a) (a->a->a), > C (FromInteger a) (Integer->a), > C (SHOW a) (a->String)) > => C (CLS (NUM a)) (NUM a) where ac _ = NUM (+$) (*$) frmInteger shw We re-visit the overloaded addition, multiplication, show and fromInteger functions, defining them now in terms of the just introduced `class' NUM. We should point out the uniformity of the declarations below, ripe for syntactic sugar. For example, one may introduce NUM a => ... to mean C (CLS (NUM a)) (NUM a) => ... > infixl 6 +$$; infixl 7 *$$ > (+$$) :: forall a. C (CLS (NUM a)) (NUM a) => a -> a -> a > (+$$) x y = nm_add (ac (__:: CLS (NUM a))) x y and similarly for the other operations. We are in a position to define a bounded existential, whose quantified type variable 'a' is restricted to members of NUM. The latter lets us use the overloaded numerical functions after opening the existential envelope. > data PACK = forall a. C (CLS (NUM a)) (NUM a) => PACK a > t1d = let x = PACK (Dual (1.0::Float) 2) in > case x of PACK y -> nshw (y *$$ y +$$ y +$$ (nfromI 2)) From joost.visser at di.uminho.pt Thu Mar 1 11:07:36 2007 From: joost.visser at di.uminho.pt (Joost Visser) Date: Thu Mar 1 11:00:53 2007 Subject: [Haskell] GTTSE 2007: 2nd call for participation (02-07 July) (registration open) Message-ID: GTTSE 2007, 02-07 July, 2007, Braga, Portugal 2nd International Summer School on Generative and Transformational Techniques in Software Engineering http://www.di.uminho.pt/GTTSE2007 ** Registration is now open ** SCOPE AND FORMAT The summer school brings together PhD students, lecturers, technology presenters, as well as other researchers and practitioners who are interested in the generation and the transformation of programs, data, models, meta-models, and documentation. This concerns many areas of software engineering: software reverse and re-engineering, model-driven approaches, automated software engineering, generic language technology, to name a few. These areas differ with regard to the specific sorts of meta-models (or grammars, schemas, formats etc.) that underlie the involved artifacts, and with regard to the specific techniques that are employed for the generation and the transformation of the artifacts. The tutorials are given by renowned representatives of complementary approaches and problem domains. Each tutorial combines foundations, methods, examples, and tool support. The program of the summer school also features invited technology presentations, which present setups for generative and transformational techniques. These presentations complement each other in terms of the chosen application domains, case studies, and the underlying concepts. The program of the school also features a participants workshop. All summer school material will be collected in proceedings that are handed out to the participants. Formal proceedings will be compiled after the summer school, where all contributions are subjected to additional reviewing. The formal proceedings of the first instance of the summer school (2005) were published as volume 4143 in the Lecture Notes in Computer Science series of Springer-Verlag. TUTORIALS * Krzysztof Czarnecki (University of Waterloo) Model Evolution * Jean-Marie Favre (University of Grenoble) Software Linguistics and Language Engineering * Stan Jarzabek (National University of Singapore) Software Reuse Beyond Components with XVCL * Oege de Moor (Oxford University) Code Queries with Datalog * Jos? Nuno Oliveira (University of Minho, Portugal) Data Transformation by Calculation * Markus Pueschel (Carnegie Mellon University) How to Write Fast Numerical Code * Walid Taha (Rice University) A Practical Guide to Building Staged Interpreters * Eelco Visser (Delft University of Technology, The Netherlands) Domain-Specific Language Engineering REGISTRATION Online registration for the summer school is now open. The registration form, as well as detailed information on conditions and fees, are available at: http://wiki.di.uminho.pt/twiki/bin/view/Events/GTTSE2007/Registration The number of participants is limited. Participants will be selected on the basis of the information they supply on their registration form. SUMMER SCHOOL CHAIRS * Ralf L?mmel (Program Chair), Microsoft Corp., Redmond, USA. * Jo?o Saraiva (Organizing Chair), Universidade do Minho, Braga, Portugal. * Joost Visser (Program Chair), Universidade do Minho, Braga, Portugal. ADDITIONAL INFORMATION For additional information on the program, venue, and other details of the summer school, please consult the web page: http://www.di.uminho.pt/GTTSE2007 For remaining questions please contact gttse2007 at di.uminho.pt. From bit at mutantlemon.com Thu Mar 1 11:32:42 2007 From: bit at mutantlemon.com (Bit Connor) Date: Thu Mar 1 11:26:04 2007 Subject: [Haskell] ANNOUNCE: OmegaGB, Haskell Game Boy Emulator Message-ID: <6205bd290703010832m30abc3ccr7460786cb99db4bd@mail.gmail.com> OmegaGB is an emulator for the Nintendo Game Boy, written in pure haskell. It's in a very early state, and only barely shows the title screen of a few games. It uses gtk2hs for the user interface, but there is also a version that doesn't require gtk2hs and uses ascii art. The main problem I am having is getting decent performance. I have set up a darcs repository in the hopes of receiving advice or patches to improve performance. You can find more information about the program at the website: http://www.mutantlemon.com/omegagb/ The program works by maintaining a state of all of the gameboy hardware: cpu registers, memory, and internal timers for various interrupts and other things. A function is used to update the state: updateMachineDisplayFrame :: JoypadKeyStates -> ((RegisterStates, Memory), IrqStates) -> (Display, ((RegisterStates, Memory), IrqStates)) This approach does not give enough performance, and the emulator is not able to run in real time. I have experimented with replacing most of the state with mutable IORefs and an IOUArray for the memory. This gave approximately double the performance, but that is still only 10% of real time speed on my computer. And all this is still without emulating most of the GB graphics hardware, which will require quite a bit more computations. I originally started this project to explore whether haskell is really a capable language in the domain of performance critical applications. I think that with the right optimizations, OmegaGB will be able to do real time emulation. Unfortunately, I am not experienced enough to know what kind of optimizations to use. This is why I am calling out for help. Thanks, Bit Connor PS: Here is some of the profiling output from a typical run: total time = 174.10 secs (3482 ticks @ 50 ms) total alloc = 31,338,925,440 bytes (excludes profiling overheads) COST CENTRE MODULE %time %alloc renderScanLine Machine 28.6 17.9 machineCpuExecute' Machine 12.6 11.4 tickHBlank Machine 9.1 21.1 tickHBlankMode0 Machine 6.3 13.7 executeInstruction Cpu 5.6 1.6 test02 GuiTest02 5.0 1.4 tickDIV Machine 4.7 13.1 irqUpdate Machine 3.4 0.8 transformIrq Machine 3.3 3.2 tickHBlankMode3 Machine 3.1 6.9 mcti Cpu 2.2 0.5 setRegState Machine 1.9 1.7 setReg2State Machine 1.7 1.8 doFromTo GuiDrawUtil 1.6 1.5 updateMachine Machine 1.4 0.5 updateMachineDisplayFrame Machine 1.3 0.5 writeFlags CpuExecution 1.2 0.3 fetchInstruction Machine 1.1 0.5 From dukedave at gmail.com Thu Mar 1 12:45:16 2007 From: dukedave at gmail.com (Dave Tapley) Date: Thu Mar 1 12:38:39 2007 Subject: [Haskell] Laziness and the IO Monad (randomness) Message-ID: Hi all, I am having a problem with the implementation of a program (a genetic algorithm) which requires randomness in it. It all hinges on the ability to generate something (in the example below an Int), then provide a function to update it such that the prelude's iteratefunction (or an equivalent) may be used. In my program I require that both the generation and the updating function contain randomness. I have drafted a (simplified) example of my problem: This code show a trivial case where randomness (and hence the IO monad) is not used and the first 10 elements of the produced list are printed: aNum :: Int aNum = 2 addTwo :: Int -> Int addTwo = (+) 2 firstTen :: [Int] firstTen = take 10 (iterate addTwo aNum) main :: IO () main = do print firstTen As required the program terminates printing: [2,4,6,8,10,12,14,16,18,20] Now I present my 'conversion' of this trivial case where we both generate a random number, and add a random amount to it upon each iteration. Again we only wish to print the first 10: import System.Random -- Taken directly from function 'rollDice' in Haskell98 report randNum :: IO Int randNum = getStdRandom (randomR (1, 6)) addRand :: Int -> IO Int addRand x = do y <- randNum return (x + y) firstTen :: IO [Int] firstTen = do infiniteNums <- iterateM addRand randNum return (take 10 infiniteNums) main :: IO () main = do tenNums <- firstTen print tenNums -- Monadic interpretation of prelude iterate definition iterateM :: Monad m => (a -> m a) -> m a -> m [a] iterateM f xM = do x <- xM mcons xM (iterateM f (f x)) -- Taken from prelude definition of sequence mcons :: Monad m => m a -> m [a] -> m [a] mcons p q = p >>= \x -> q >>= \y -> return (x:y) However this latter case gets stuck in an infinite loop, terminating on a stack overflow. My question asks why this is the case, when laziness should ensure only the first 10 cases need to be computed. If anyone wishes to suggest another way entirely to approach this problem that would also be welcome! Many Thanks, Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.haskell.org/pipermail/haskell/attachments/20070301/f6273a81/attachment-0001.htm From haskell2 at davidb.org Thu Mar 1 13:17:19 2007 From: haskell2 at davidb.org (David Brown) Date: Thu Mar 1 13:10:42 2007 Subject: [Haskell] Laziness and the IO Monad (randomness) In-Reply-To: References: Message-ID: <45E718AF.30200@davidb.org> Dave Tapley wrote: > This code show a trivial case where randomness (and hence the IO > monad) is not used and the first 10 elements of the produced list > are printed: You don't need the IO monad to achieve pseudy-randomness. Why not use 'randoms' from System.Random (or 'randomRs' for a range). take 10 $ (randomRs (1,6) (mkStdGen 1)) :: [Int] You can use the IO monad to get a randomly seeded generator from the outside, but once seeded, just use the list. gen <- newStdGen take 10 $ (randomRs (1,6) gen) :: [Int] Dave From taralx at gmail.com Thu Mar 1 14:07:55 2007 From: taralx at gmail.com (Taral) Date: Thu Mar 1 14:01:20 2007 Subject: [Haskell] Laziness and the IO Monad (randomness) In-Reply-To: References: Message-ID: On 3/1/07, Dave Tapley wrote: > My question asks why this is the case, when laziness should ensure only the > first 10 cases need to be computed. Basically, because the IO monad is strict, not lazy. If you want laziness, don't use the IO monad. -- Taral "You can't prove anything." -- G?del's Incompetence Theorem From paul at cogito.org.uk Thu Mar 1 15:50:33 2007 From: paul at cogito.org.uk (Paul Johnson) Date: Thu Mar 1 15:43:59 2007 Subject: [Haskell] Laziness and the IO Monad (randomness) In-Reply-To: <45E718AF.30200@davidb.org> References: <45E718AF.30200@davidb.org> Message-ID: <45E73C99.3030406@cogito.org.uk> David Brown wrote: > Dave Tapley wrote: > > >> This code show a trivial case where randomness (and hence the IO >> monad) is not used and the first 10 elements of the produced list >> are printed: >> > > You don't need the IO monad to achieve pseudy-randomness. Why not use > 'randoms' from System.Random (or 'randomRs' for a range). > > take 10 $ (randomRs (1,6) (mkStdGen 1)) :: [Int] > The other possibility, which would work better in a non-toy problem, is to encapsulate the random numbers in a state monad. That way, rather than using the IO monad (with all its complexity) you can just have a monad of randomness (along with a Bag of Holding and a +2 sword). The trick is to use the split operation when you need to do something lazy. "split" forks the generator into two generators, so you can use one as the generator in your lazy stream and the other for the next step in your random computation. Or you could use "Gen" from Test.QuickCheck, which basically does this already. The Wikibook chapter on random numbers explains this. Paul. From joe.thornber at gmail.com Fri Mar 2 08:21:37 2007 From: joe.thornber at gmail.com (Joe Thornber) Date: Fri Mar 2 08:14:57 2007 Subject: [Haskell] Laziness and the IO Monad (randomness) In-Reply-To: References: Message-ID: <95d3ae170703020521h63b283f8v472ad04169dadf57@mail.gmail.com> On 01/03/07, Dave Tapley wrote: > My question asks why this is the case, when laziness should ensure only the > first 10 cases need to be computed. Just to clarify some of the other answers you've got. Saying the IO monad is strict isn't the whole picture, after all 'do {txt <- getContents; putStrLn $ transform txt}' doesn't read all the contents in before transforming it. The reason your program hangs is that you are trying to return an infinite list generated from an _infinite sequence of IO actions_. This example might help: > getList1, getList2, getList3 :: IO [Int] > getList1 = return . repeat $ 0 > getList2 = do {lst <- getList2; return $ 0 : lst} > getList3 = sequence . repeat . return $ 0 > main = do > lst <- getList1 > putStrLn . show . take 10 $ lst getList1 will work in the lazy way that you expected. getList2 and getList3 are equivalent to each other and similar to your iterateM, they will loop forever. I hope this helps, - Joe From dmhouse at gmail.com Fri Mar 2 17:50:19 2007 From: dmhouse at gmail.com (David House) Date: Fri Mar 2 17:44:12 2007 Subject: [Haskell] ANNC: hoogle.el Message-ID: Hoogle.el is a simple Emacs Lisp library that nicely integrates Hoogle into Emacs. http://haskell.org/haskellwiki/Hoogle.el Here's the docstring from the only function it provides: hoogle-lookup: "Lookup the identifier at point in Hoogle. If we can't find an identifier at the point, or with a prefix arg of 1, prompts for a name to look up. If we can find a Hoogle in the $PATH (using `executable-find' on `hoogle-local-command'), it will be used, unless `hoogle-always-use-web' is non-nil. For web Hoogling, the name is appended to `hoogle-url-base' and `browse-url' is invoked." The file is based on work by myself, Clemens Fruhwirth and Andy Hefner. I welcome any comments. -- -David House, dmhouse@gmail.com From g9ks157k at acme.softbase.org Sat Mar 3 19:10:02 2007 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Sat Mar 3 19:03:27 2007 Subject: [Haskell] Haddock not being able to read interface file Message-ID: <200703040110.02927.g9ks157k@acme.softbase.org> Hello, I want to generate Haddock documentation for some Haskell files and want to create hyperlinks to the base package?s documentation. I?ve downloaded and use the option --read-interface=http://www.haskell.org/ghc/docs/latest/html/libraries/base,base.haddock in my Haddock command line. However, Haddock outputs the following: haddock: Warning: The interface file "base.haddock" could not be read. Maybe it's from a later version of Haddock? This happens with Haddock 0.8 as well as the current development version of Haddock. What?s wrong here? Best wishes, Wolfgang From claus.reinke at talk21.com Sun Mar 4 08:55:09 2007 From: claus.reinke at talk21.com (Claus Reinke) Date: Sun Mar 4 08:48:29 2007 Subject: [Haskell] ANNOUNCE: Doc.vim - Haddock display and Haddock index goodies for Vim References: <01aa01c75d3c$d60792f0$cb098351@cr3lt> <003801c75dc4$2fa73950$31238351@cr3lt> Message-ID: <005f01c75e64$b9fa5600$390f8351@cr3lt> the recent discussion about a simpler url-interface to library haddocks prompted me to write some vimscript to make use of the existing interface. the initial idea was just to translate qualified name and package into a url to launch a browser with. but as people pointed out, having to know the qualified name and even the package makes for an inconvenient interface. so the second version read haddocks index files to populate a dictionary of unqualified names and symbols, pointing to possible qualifiers and urls. once we have such a handy documentation index, we can play other ide-style games as well, so the current version (attached) adds a few more goodies. some inspection necessary: this is not a proper, portable, out-of-the-box release! the script has been tested with gvim 7.0 on windows, using the haddocks released with ghc-6.4.1, and opera as the browser. to adapt it for other systems, you'll need to change some paths and probably the :start command. feedback/fixes welcome. what is on offer:-) :IDoc "" -- suggest possible qualifiers, then launch doc browser :Doc "","" -- old-style invocation :DocIndex -- populate index from haddock index html files (takes a few secs) CTRL-X CTRL-U -- one of the user-defined insert-mode completions -- does now complete unqualified ids wrt the doc index _? -- for unqualified id under cursor, suggest possible qualifiers, browse _. -- replace unqualified id under cursor with fully qualified version so you can place your cursor on 'mapM_', type '_?', select Prelude or Control.Monad, and find out what it is all about. or you can type 'pres', and still in insert mode, type CTRL-X CTRL-U, find 'preservingMatrix' as one of the possible completions, and select it. or you can place your cursor on 'preservingMatrix', type '_.', select one of the options, and have it replaced with 'Graphics.Rendering.OpenGL.preservingMatrix'. (for those who believe in gui rather than functionality as the distinction between ides and editors, the last three use little popup menus in gui vim;) how to: read the script to check that it does what you'd expect, adapt where necessary, then :source it, run :DocIndex (this takes a few seconds, so we should probably cache the result in more vim-friendly format somewhere later..), and play. as usual, no guarantees of any kind. feel free to adapt this for your haskell filetype plugins. and i'm sure that the ideas carry over to other intelligent editors, so perhaps someone will come up with an emacs variant?-) enjoy, claus -------------- next part -------------- A non-text attachment was scrubbed... Name: Doc.vim Type: application/octet-stream Size: 7367 bytes Desc: not available Url : http://www.haskell.org/pipermail/haskell/attachments/20070304/ca72c5bc/Doc.obj From haskell2 at davidb.org Sun Mar 4 23:40:13 2007 From: haskell2 at davidb.org (David Brown) Date: Sun Mar 4 23:33:27 2007 Subject: [Haskell] Announcing harchive: Backup and restore software in Haskell. Message-ID: <45EB9F2D.3040802@davidb.org> Announcing release 0.1 of "harchive", a program for backing up and restoring data. I've included a brief feature list below. The code is available in darcs at: http://www.davidb.org/darcs/harchive/ The connection isn't all that fast, so if it gets too busy, I'll move it somewhere else. This software is in a very early stage, but is at the point where others may be interested in looking at it. It does demonstrate that Haskell (at least GHC) is indeed useful for this kind of low-level seeming task. Thanks, David Brown Harchive version 0.1. - Implemented, with support for the following. - Client/server model. The backup is stored in a file pool with the hpool program. The hfile program can access this pool over tcp (no authentication or encryption, so be careful). - Stores data from multiple backups and multiple machines in a content addressible store. Duplicated data even on separate machines will not take additional space. Collisions can be made arbitrarily improbable by choice of hash function size (not easily changeable, in the current code, though). - Pool manager uses Sqlite3 specific capabilities to get efficient storage of the pool index. Sqlite3 is a custom binding to Sqlite3 to take advantage of these capabilities. - Uses openssl's sha1 library. Wouldn't be difficult to use a different library (there are license issues with openssl). Generally the program's performance is bound by the speed of hashing and/or the speed of data compression. - Uses Duncan Coutts' zlib library to get good zlib speed. - Linux dependent. Uses the output of '/sbin/blkid' to map devices to UUIDs of the filesystems to get persistent, and unique identifiers for each filesystem. - Has a primitive status display ('-v') during backup. - Able to backup and restore directories/filesystems. Restore semantics are as accurate as I can get them without extra strange semantics. - Multithreaded backup. Allows backup to run at high speed, even while waiting for cache responses from the server. Does not need to be built with '-threaded'. - Restore is reasonably simple. It tends to get tested less, so it is beneficial to move complexity to the backup side. From dons at cse.unsw.edu.au Mon Mar 5 00:48:15 2007 From: dons at cse.unsw.edu.au (Donald Bruce Stewart) Date: Mon Mar 5 00:47:20 2007 Subject: [Haskell] Haskell Weekly News: March 05, 2007 Message-ID: <20070305054815.GH23490@cse.unsw.EDU.AU> --------------------------------------------------------------------------- Haskell Weekly News http://sequence.complete.org/hwn/20070305 Issue 58 - March 05, 2007 --------------------------------------------------------------------------- Welcome to issue 58 of HWN, a weekly newsletter covering developments in the [1]Haskell community. 1. http://haskell.org/ Announcements New Book - Programming in Haskell. Graham Hutton [2]announced a new Haskell textbook: [3]Programming in Haskell. This introduction is ideal for beginner programmers: it requires no previous programming experience and all concepts are explained from first principles via carefully chosen examples. Each chapter includes exercises that range from the straightforward to extended projects, plus suggestions for further reading on more advanced topics. The presentation is clear and simple, and benefits from having been refined and class-tested over several years. 2. http://article.gmane.org/gmane.comp.lang.haskell.general/14849 3. http://www.cs.nott.ac.uk/~gmh/book.html Gtk2Hs version 0.9.11. Duncan Coutts [4]announced Gtk2Hs - a GUI Library for Haskell based on Gtk+, version 0.9.11, is [5]now available. Gtk2Hs features: automatic memory management; Unicode support; nearly full coverage of Gtk+ 2.8 API; support for several additional Gtk+/Gnome modules (Glade visual GUI builder, cairo vector graphics, SVG rendering, OpenGL extension and more). 4. http://article.gmane.org/gmane.comp.lang.haskell.general/14934 5. http://haskell.org/gtk2hs/download/ cabal-make version 0.1. Conal Elliott [6]announced Cabal-make, a GNU make include file to be used with Cabal in creating and sharing Haskell packages. A few highlights: web-based, cross-package links in Haddock docs; syntax coloring via hscolour, with per-project CSS; links from the Haddock docs to hscolour'd code and to wiki-based user comment pages. [7]It is available here. 6. http://article.gmane.org/gmane.comp.lang.haskell.general/14891 7. http://haskell.org/haskellwiki/Cabal-make Vty 3.0.0. Stefan O'Rear [8]announced a new major of [9]vty, featuring improved performance. vty is notably used in yi to provide a terminal interface supporting syntax highlighting. 8. http://article.gmane.org/gmane.comp.lang.haskell.general/14876 9. http://members.cox.net/stefanor/vty/dist/doc/html/index.html Haskell Xcode Plugin. Lyndon Tremblay [10]announced the first release of [11]a plugin for Xcode enabling Haskell syntax highlighting, Xcode projects compiling and linking, and a couple missing features, for Haskell (GHC). 10. http://article.gmane.org/gmane.comp.lang.haskell.general/14875 11. http://www.hoovy.org/HaskellXcodePlugin/ urlcheck 0.1: parallel link checker. Don Stewart [12]announced the first release of [13]urlcheck, an parallel link checker, written in Haskell. Frustrated with the resources and time consumed by 'linkchecker', urlcheck is a lightweight, smp-capable replacement in Haskell. urlcheck pings urls found in the input file, checking they aren't 404s. It uses Haskell threads to run queries concurrently, and can transparently utilise multiple cores if you have them. 12. http://article.gmane.org/gmane.comp.lang.haskell.general/14863 13. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/urlcheck-0.1 The Monad.Reader: call for copy. Wouter Swierstra [14]welcomed articles for the next issue of The Monad.Reader. Submit articles for the next issue by e-mail before April 13th, 2007. Articles should be written according to the guidelines available from [15]The Monad Reader home. 14. http://article.gmane.org/gmane.comp.lang.haskell.general/14870 15. http://www.haskell.org/haskellwiki/TheMonadReader TV-0.2 and GuiTV-0.2. Conal Elliott [16]announced TV, a library for composing tangible values ('TVs'), values that carry along external interfaces. In particular, TVs can be composed to create new TVs, and they can be directly executed with various kinds of interfaces. Values and interfaces are combined for direct use, and separable for composition. GuiTV adds graphical user interfaces to the TV (tangible value) framework, using Phooey. The functionality was part of TV up to version 0.1.1, and is now moved out to a new package to eliminate the dependency of core TV on Phooey and hence on wxHaskell, as the latter can be difficult to install. 16. http://article.gmane.org/gmane.comp.lang.haskell.general/14862 Haskell-mode 2.2. Stefan Monnier [17]released version 2.2 of [18]the Haskell-mode package for Emacs. It has very few visible changes, mostly some commands to query an underlying interactive hugs/ghci in order to get type/info about specific identifiers. 17. http://article.gmane.org/gmane.comp.lang.haskell.general/14857 18. http://www.iro.umontreal.ca/~monnier/elisp/ Data.CompactString 0.1. Twan van Laarhoven [19]announced a beta [20]Unicode version of Data.ByteString. The library uses a variable length encoding (1 to 3 bytes) of Chars into Word8s, which are then stored in a ByteString. 19. http://thread.gmane.org/gmane.comp.lang.haskell.general/14834 20. http://twan.home.fmf.nl/compact-string/ HSXML version 1.13. Oleg Kiselyov [21]announced version 1.13 of [22]HSXML. HSXML is a library for writing and transforming typed semi-structured data in Haskell -- in S-expression syntax, with the extensible set of `tags', and statically enforced content model restrictions. A particular application is writing web pages in Haskell. We obtain HTML, XHTML or other output formats by running the Haskell web page in an appropriate rendering monad. The benefit of representing XML-like documents as a typed data structure/Haskell code is static rejection of bad documents -- not only those with undeclared tags but also those where elements appear in wrong contexts. 21. http://thread.gmane.org/gmane.comp.lang.haskell.general/14835 22. http://pobox.com/~oleg/ftp/Scheme/xml.html#typed-SXML Haskell XML Toolbox 7.1. Uwe Schmidt [23]announced a new version of [24]the Haskell XML Toolbox. The main change is the step from cvs to darcs. The documentation has source links into [25]the darcs repository. [26]A tutorial is available in the Haskell wiki. 23. http://article.gmane.org/gmane.comp.lang.haskell.general/14831 24. http://www.fh-wedel.de/~si/HXmlToolbox/index.html 25. http://darcs.fh-wedel.de/hxt 26. http://www.haskell.org/haskellwiki/HXT OmegaGB, Haskell Game Boy Emulator. Bit Connor [27]announced OmegaGB, an emulator for the Nintendo Game Boy, written in pure Haskell. It uses gtk2hs for the user interface, but there is also a version that doesn't require gtk2hs and uses ascii art. You can find more information about the program at [28]the website. 27. http://article.gmane.org/gmane.comp.lang.haskell.general/14938 28. http://www.mutantlemon.com/omegagb/ Takusen 0.6. Oleg and Alistair [29]announced a new release of [30]Takusen, the database library for Haskell. There are a large number of changes and bug-fixes in this release, including improved Oracle and PostgreSQL support. 29. http://article.gmane.org/gmane.comp.lang.haskell.libraries/6209/ 30. http://darcs.haskell.org/takusen hoogle.el. David House [31]announced Hoogle.el, a simple Emacs Lisp library that nicely integrates [32]Hoogle into Emacs. 31. http://article.gmane.org/gmane.comp.lang.haskell.general/14944 32. http://haskell.org/haskellwiki/Hoogle.el Buggy nofib. Josep Silva Galiana [33]announced a 'buggy' version of the nofib collection of Haskell programs. [34]All programs contain one of these bugs: a bug that produces an incorrect result; a bug that produces non-termination; a bug that produces an exception (e.g., div by zero). [35]The buggy nofib suite can be used to test debugging tools. 33. http://article.gmane.org/gmane.comp.lang.haskell.general/14825 34. http://einstein.dsic.upv.es/darcs/nofib 35. http://einstein.dsic.upv.es/nofib nobench: Haskell implementation shootout. Don Stewart [36]announced nobench, a cross-implementation performance benchmark suite, based on nofib, [37]comparing the performance of various Haskell compilers and bytecode interpreters on a range of programs. 36. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19684 37. http://www.cse.unsw.edu.au/~dons/nobench.html Derangement version 0.1.0. Dennis Griffith [38]announced the initial version of derangement, a library for finding a derangement of a set. A derangement of a set is a permutation with no fixed points, like many constrained matching problems it is susceptible to solution via a Max-flow algorithm. 38. http://article.gmane.org/gmane.comp.lang.haskell.cafe/19714 HSH 1.0.0. John Goerzen [39]announced the first release of HSH. HSH is designed to let you mix and match shell expressions with Haskell programs. With HSH, it is possible to easily run shell commands, capture their output or provide their input, and pipe them to/from other shell commands and arbitrary Haskell functions at will. HSH makes it easy to run shell commands. But its real power is in piping. You can pipe -- arbitrarily -- between external programs, pure Haskell functions, and Haskell IO functions 39. http://article.gmane.org/gmane.comp.lang.haskell.cafe/20053 A new Haskell cookbook. Martin Bishop [40]began a preliminary page, and fleshed out some of the headers/sub-headers on the wiki page for a good Haskell Cookbook (not a PLEAC clone). [41]Please contribute. 40. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19790 41. http://haskell.org/haskellwiki/Cookbook Haskell' This section covers the [42]Haskell' standardisation process. * [43]Global variables * [44]Polymorphic components, so far * [45]do-and-if-then-else modification * [46]Fixity resolution, possible specification * [47]Disjunctive tuples 42. http://hackage.haskell.org/trac/haskell-prime 43. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2054 44. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2076 45. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2120 46. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2121 47. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2133 Libraries This week's proposals and extensions to the [48]standard libraries. * [49]Data.Proxy * [50]Add extra readline completion functionality * [51]Control.Monad.Cont documentation * [52]Add First and Last wrappers around Maybe to Data.Monoid * [53]Add ioeGetLocation, ioeSetLocation to System/IO/Error.hs 48. http://haskell.org/haskellwiki/Library_submissions 49. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6238 50. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6256 51. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6287 52. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6319 53. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6320 Discussion Haskell with only one typeclass. Oleg Kiselyov [54]described how, if the ability to define typeclasses is removed from Haskell, no expressivity is lost. If Haskell had only one, pre-defined typeclass with only one method, we could still do normal Haskell programming with standard and user-defined overloaded numerical functions, monads, monad transformers, etc. Haskell with only one typeclass can express all of Haskell98 typeclass programming idioms including constructor classes, plus multi-parameter type classes and some functional dependencies. 54. http://article.gmane.org/gmane.comp.lang.haskell.general/14936 Data type declarations are implicitly moduled. Chris Moline [55]proposed an idea to allow multiple data declarations to share constructors by having them be implicitly declared inside a module. 55. http://article.gmane.org/gmane.comp.lang.haskell.general/14847 Importance of MonadRandom. Yitzchak Gale [56]pointed out the importance of Cale Gibbard's [57]MonadRandom. This monad makes it possible to write functions that use randomness without having to specify in advance whether the source of randomness will be a pure pseudorandom number generator, as in System.Random, or physical randomness via the IO monad, such as your operating system's source of physical randomness, or random.org, or a hardware random generator. 56. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19058 57. http://www.haskell.org/haskellwiki/New_monads/MonadRandom Become a GHC build slave!. Simon Marlow [58]pointed out that, thanks largely to Ian Lynagh, GHC now has a BuildBot infrastructure to automate nightly builds on multiple platforms. This replaces the old set of shell scripts that we used to run nightly builds; now adding new clients to the setup is [59]relatively easy. So far we have various Windows builds running, and I'll be moving over the existing Linux nightly builds in due course. 58. http://article.gmane.org/gmane.comp.lang.haskell.cafe/19103 59. http://hackage.haskell.org/trac/ghc/wiki/BuildBot Editor support for low level hacking. Don Stewart [60]mentioned some tools used for making low level optimisation of GHC Haskell code easier 60. http://article.gmane.org/gmane.comp.lang.haskell.cafe/19348 Optimisation fun. Creighton Hogg [61]sparked a long thread on optimising prime sieves in Haskell 61. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19380 OO Design in Haskell Example. Steve Downey [62]began a thread on OO design in Haskell 62. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19897 Safe lists with GADTs. Neil Mitchell [63]explored a safe version of head and tail, on a safe version of lists, using GADTs 63. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19901 Jobs Research position at Nokia Research Center. Jamey Hicks [64]announced the availability of a senior research engineer position at Nokia Research Center Cambridge, US. They are seeking an exceptional, highly motivated individual who is interested in a unique opportunity to collaborate with a world-class academic research community. This position is for the Armo project at NRC Cambridge, using Bluespec hardware description language to radically improve Nokia's ability to develop advanced SOCs and corresponding software for future mobile phones and mobile computers. We are investigating co-development of hardware and software components for such devices. Success in the project will lead to both academic publication as well as a significant positive impact on Nokia products and engineering. 64. http://article.gmane.org/gmane.comp.lang.haskell.general/14901 New PhD Positions Computing Science, Chalmers University. Koen Claessen [65]announced new [66]PhD positions for 2007, at Chalmers University of Technology. The focus is on algorithms, bioinformatics, distributed systems and computing, functional programming, formal methods, interaction design, language technology, language based security, parallel and high performance computing, programming logic and type theory, but research is not restricted to these topics. 65. http://article.gmane.org/gmane.comp.lang.haskell.general/14900 66. http://chalmersnyheter.chalmers.se/chalmers03/english/eng_vacanciesarticle.jsp?article=8730 Positions at Oxford: refactoring tools. Oege.de.Moor [67]announced the availability of positions in the Programming Tools Group at Oxford, researching aspect refactoring tools 67. http://article.gmane.org/gmane.comp.lang.haskell.general/14860 Blog noise [68]Haskell news from the blogosphere. * [69]Writing a Simple Search Engine in Haskell: Part 0 - Introduction * [70]Writing a Simple Search Engine in Haskell: Part 1 Maybe and List * [71]Haskell IO for Imperative Programmers * [72]Quotient Types for Information Hiding * [73]How Many Functions are There of Type Bool -> Bool? * [74]Macros for Haskell? Done. * [75]More on Haskell, Side Effects and Code Reuse * [76]The theory of monads * [77]Writing code by types * [78]Haskell: open secret in Ruby land * [79]Ruby vs Haskell: choose what works * [80]Real time Haskell * [81]Folds and functional programming * [82]Countable Ordinals in Haskell * [83]Haskell * [84]Programming and the Metaphorical Mind * [85]Languages and the semiskilled developer * [86]Building a Firewall Against Complexity * [87]The Killer App for a new language * [88]Time travel in Haskell * [89]Comonads and reading from the future * [90]Flirting with Functional Programming * [91]A fold-like procedure in C * [92]Monads in Qi * [93]Monads work because they have a tight interface * [94]What's wrong with for loops * [95]More on what's wrong with for loops * [96]Haskell, CAL and Scala * [97]Haskell: Queues without pointers * [98]Type Classes: Not Quite Overloading * [99]Generalised Algebraic Data Types, Phantom Types, and Dependent Types * [100]An IRC client/server in Haskell * [101]Language design: grand architecture versus feature collections * [102]Thoughts on one week in Haskell * [103]Why its hard for imperative programmers to learn Haskell * [104]Refunctoring with polymorphism * [105]Introductory console IO in Haskell * [106]Learn the lambda calculus * [107]Haskell for Alphas and Betas * [108]My evolution as a Haskell programmer * [109]On learning Haskell * [110]Greenspun's Tenth Rule applied to Haskell * [111]Cabal with rpm goodness * [112]F# * [113]Arithemtic coding in Haskell * [114]A filesystem tree printer * [115]Using Bayesian filtering instead of 'if' in Haskell * [116]Combinator parsing * [117]Monads for vector spaces, probability and quantum mechanics pt. I * [118]Monads, Vector Spaces and Quantum Mechanics pt. II * [119]Learning the Haskell programming language * [120]A twisted history of monad transformers * [121]Monadic parsing * [122]Forth as a Haskell DSL * [123]A better environment for shell scripting * [124]Smart classification using Bayesian monads in Haskell * [125]Haskell like data structures in Common Lisp 68. http://planet.haskell.org/ 69. http://blogs.nubgames.com/code/?p=18 70. http://blogs.nubgames.com/code/?p=19 71. http://blogs.nubgames.com/code/?p=22 72. http://japple.blogspot.com/2007/01/quotient-types-for-information-hiding.html 73. http://japple.blogspot.com/2007/01/how-many-functions-are-there-of-type.html 74. http://clemens.endorphin.org/weblog/archives/2007-01.shtml#e2007-01-31T12_21_00.txt 75. http://neilbartlett.name/blog/?p=13 76. http://scienceblogs.com/goodmath/2007/01/the_theory_of_monads_and_the_m_1.php 77. http://neilmitchell.blogspot.com/2007/01/writing-code-by-types.html 78. http://notes-on-haskell.blogspot.com/2007/01/haskell-open-secret.html 79. http://notes-on-haskell.blogspot.com/2007/01/ruby-vs-haskell-choose-what-works.html 80. http://mikeburrell.wordpress.com/2007/02/01/real-time-haskell/ 81. http://mikeburrell.wordpress.com/2007/02/01/functional-idempotence-optimization/ 82. http://japple.blogspot.com/2007/02/countable-ordinals-in-haskell.html 83. http://vanirsystems.com/danielsblog/?p=103 84. http://toomuchcode.blogspot.com/2007/02/part-1-programming-and-metaphorical.html 85. http://toomuchcode.blogspot.com/2007/02/part-2-languages-and-lesser-skilled.html 86. http://toomuchcode.blogspot.com/2007/02/building-firewall-against-complexity.html 87. http://toomuchcode.blogspot.com/2007/02/part-4-killer-app.html 88. http://community.livejournal.com/evan_tech/216270.html 89. http://sigfpe.blogspot.com/2007/02/comonads-and-reading-from-future.html 90. http://johnleesmiller.blogspot.com/2007/02/first-post.html 91. http://www.yomi.at/archive/2007/02/115 92. http://programmingkungfuqi.blogspot.com/2007/02/monads-in-qi.html 93. http://www.sdowney.org/2007/01/monads-rest-and-c-template.html 94. http://notes-on-haskell.blogspot.com/2007/02/whats-wrong-with-for-loop.html 95. http://notes-on-haskell.blogspot.com/2007/02/whats-wrong-with-for-loop-revisited.html 96. http://blog.tmorris.net/ignorance-is-mostly-bliss-but-not-always/ 97. http://www.randomhacks.net/articles/2007/02/08/haskell-queues-without-pointers 98. http://www.cs.nott.ac.uk/~pni/Papers/Notes/typeClassOvld.html 99. http://www.cs.nott.ac.uk/~pni/Papers/Notes/GADTs.html 100. http://blog.nurd.se/hype/?p=30 101. http://www.dysfunctor.org/2007/02/13/architecture-vs-features/ 102. http://kevin.scaldeferri.com/blog/2007/02/12/OneWeek.html 103. http://qftblog.wordpress.com/2007/02/14/why-its-so-hard-for-imperative-programmers-to-learn-funtional-languages/ 104. http://blog.tmorris.net/refunctoring/ 105. http://cod3po37ry.blogspot.com/2007/02/more-on-haskell-io-and-interact.html 106. http://foreigndispatches.typepad.com/dispatches/2007/02/an_introduction.html 107. http://paulspontifications.blogspot.com/2007/02/haskell-for-alphas-and-betas.html 108. http://onthebalcony.wordpress.com/2007/02/19/my-evolution-as-a-haskell-programmer/ 109. http://osfameron.vox.com/library/post/on-learning-haskell.html 110. http://japple.blogspot.com/2007/02/conors-rule.html 111. http://www.serpentine.com/blog/2007/02/20/haskell-cabal-now-with-extra-crunchy-rpm-goodness/ 112. http://reddevnews.com/news/devnews/article.aspx?editorialsid=164 113. http://vandreev.wordpress.com/2007/01/07/arithmetic-coding/ 114. http://blog.moertel.com/articles/2007/02/22/a-simple-directory-tree-printer-in-haskell 115. http://www.randomhacks.net/articles/2007/02/22/bayes-rule-and-drug-tests 116. http://mikeburrell.wordpress.com/2007/02/25/combinator-parsing/ 117. http://sigfpe.blogspot.com/2007/02/monads-for-vector-spaces-probability.html 118. http://sigfpe.wordpress.com/2007/03/04/monads-vector-spaces-and-quantum-mechanics-pt-ii/ 119. http://printf.wordpress.com/2007/02/27/haskell-functional-programming-language/ 120. http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Monad_transformers.html 121. http://gbacon.blogspot.com/2007/02/my-first-monadic-program.html 122. http://shaurz.wordpress.com/2007/03/03/forth-as-a-haskell-dsl-or-lambda-the-ultimate-stack/ 123. http://changelog.complete.org/posts/587-A-better-environment-for-shell-scripting.html 124. http://www.randomhacks.net/articles/2007/03/03/smart-classification-with-haskell 125. http://common-lisp.net/project/patty/patty.html Quotes of the Week * sleepingsquirrel: Programming in Haskell is like having an interactive conversation with a teleportation machine. You tell it you want to go to some place warm and sandy. The machine complains about ambiguous constraints. So you tell it that there should be plenty of free tropical fruit drinks. It carps 'Inferred location less polymorphic than expected'. Whoops, free flowing that is... After a few more iterations, there's a little puff of smoke, and at the sound of the chimes, you discover you're now on the beach in Tahiti. And although you've used the machine many times before, you can't help but be impressed that it usually 'Just works' most of the time. * jmillikin: If I had to work on code with performance requirements, Haskell would be my choice (followed by C++). Haskell has functional goodness with the ability to break into imperative mode, and C++ gives me direct memory management with a few functional pieces. * Cale: It ought to be called simonPerformIO, and only used if your first name is Simon * monochrom: m a -> (a -> m b) -> m b is much more to the point than 'mumble computation mumble computation' * mwc: There's a time when your brain doesn't get the monads. Then something violent and irreversable happens and you hate every other language for not having monads Code Watch Wed Feb 28 05:07:14 PST 2007. Simon Marlow. [126]Remove vectored returns. We recently discovered that they aren't a win any more, and just cost code size. 126. http://article.gmane.org/gmane.comp.lang.haskell.cvs.ghc/19418 Wed Feb 21 09:04:01 PST 2007. simonpj. [127]Allow GADT syntax for newtypes 127. http://article.gmane.org/gmane.comp.lang.haskell.cvs.ghc/19344 About the Haskell Weekly News Each week, new editions are posted to [128]the Haskell mailing list as well as to [129]the Haskell Sequence and [130]Planet Haskell. [131]RSS is also available, and headlines appear on [132]haskell.org. Headlines are available as [133]PDF. To help create new editions of this newsletter, please see the [134]contributing information. Send stories to dons at cse.unsw.edu.au. The darcs repository is available at darcs get [135]http://www.cse.unsw.edu.au/~dons/code/hwn 128. http://www.haskell.org/mailman/listinfo/haskell 129. http://sequence.complete.org/ 130. http://planet.haskell.org/ 131. http://sequence.complete.org/node/feed 132. http://haskell.org/ 133. http://www.cse.unsw.edu.au/~dons/code/hwn/archives/20070305.pdf 134. http://haskell.org/haskellwiki/HWN 135. http://www.cse.unsw.edu.au/~dons/code/hwn From goenzoy at web.de Tue Mar 6 04:30:06 2007 From: goenzoy at web.de (Gottfried F. Zojer) Date: Tue Mar 6 04:23:14 2007 Subject: [Haskell] Haskell Dependency/Installation FilePath Message-ID: <159980439@web.de> Hallo to all, Tried to install MissingH ,something what failed because Filepath is missing. Any idea why the setup file isnt in the position to find it,even if it is there(see GHCi log down ) Any feedback welcome Best regards Gottfried www.wirtschaftswunder.co.uk www.5152.eu ___________________________________________________________________________________ missingh>setup configure setup: Warning: No license-file field. Configuring MissingH-0.18.0... configure: C:\ghc\ghc-6.6\bin\ghc-pkg.exe configure: Dependency network-any: using network-2.0 configure: Dependency parsec-any: using parsec-2.0 configure: Dependency base-any: using base-2.0 configure: Dependency haskell98-any: using haskell98-1.0 configure: Dependency mtl-any: using mtl-1.0 configure: Dependency HUnit-any: using HUnit-1.1 configure: Dependency regex-compat-any: using regex-compat-0.71 configure: Dependency QuickCheck-any: using QuickCheck-1.0 setup: cannot satisfy dependency FilePath-any C:\server\missingh_0.18.1\missingh>setup build setup: error reading ./.setup-config; run "setup configure" command? ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \____/\/ /_/\____/|_| Type :? for help. Loading package base ... linking ... done. [1 of 1] Compiling Main ( C:/ghc/ghc-6.6/filepath-0.11/filepath/Setu p.hs, interpreted ) Ok, modules loaded: Main. *Main> From ndmitchell at gmail.com Tue Mar 6 04:33:01 2007 From: ndmitchell at gmail.com (Neil Mitchell) Date: Tue Mar 6 04:26:08 2007 Subject: [Haskell] Haskell Dependency/Installation FilePath In-Reply-To: <159980439@web.de> References: <159980439@web.de> Message-ID: <404396ef0703060133j39f1a21n27379835d9428833@mail.gmail.com> Hi > Loading package base ... linking ... done. > [1 of 1] Compiling Main ( C:/ghc/ghc-6.6/filepath-0.11/filepath/Setu > p.hs, interpreted ) > Ok, modules loaded: Main. > *Main> You have probably downloaded FilePath, but not installed it. Try: cd C:/ghc/ghc-6.6/filepath-0.11/filepath runhaskell Setup configure runhaskell Setup build runhaskell Setup install Then attempt the installation of MissingH again. Thanks Neil From simonmarhaskell at gmail.com Tue Mar 6 06:09:53 2007 From: simonmarhaskell at gmail.com (Simon Marlow) Date: Tue Mar 6 06:03:01 2007 Subject: [Haskell] Haddock not being able to read interface file In-Reply-To: <200703040110.02927.g9ks157k@acme.softbase.org> References: <200703040110.02927.g9ks157k@acme.softbase.org> Message-ID: <45ED4C01.9010801@gmail.com> Wolfgang Jeltsch wrote: > Hello, > > I want to generate Haddock documentation for some Haskell files and want to > create hyperlinks to the base package?s documentation. I?ve downloaded > and > use the option > > --read-interface=http://www.haskell.org/ghc/docs/latest/html/libraries/base,base.haddock > > in my Haddock command line. However, Haddock outputs the following: > > haddock: Warning: The interface file "base.haddock" could not be read. > Maybe it's from a later version of Haddock? > > This happens with Haddock 0.8 as well as the current development version of > Haddock. It's possible the interface files are not portable between 32 and 64-bit machines, and you're using one generated for a different word size. I haven't verified this, but I'll make a note to check for the next version of Haddock. I imagine we'll move to using Data.Binary anyway, which should fix any non-portability issues. Cheers, Simon From g9ks157k at acme.softbase.org Tue Mar 6 11:19:43 2007 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Tue Mar 6 11:15:03 2007 Subject: [Haskell] Haddock not being able to read interface file In-Reply-To: <45ED4C01.9010801@gmail.com> References: <200703040110.02927.g9ks157k@acme.softbase.org> <45ED4C01.9010801@gmail.com> Message-ID: <200703061719.43673.g9ks157k@acme.softbase.org> Am Dienstag, 6. M?rz 2007 12:09 schrieben Sie: > Wolfgang Jeltsch wrote: > [?] > > However, Haddock outputs the following: > > > > haddock: Warning: The interface file "base.haddock" could not be > > read. Maybe it's from a later version of Haddock? > > > > This happens with Haddock 0.8 as well as the current development version > > of Haddock. > > It's possible the interface files are not portable between 32 and 64-bit > machines, and you're using one generated for a different word size. I > haven't verified this, but I'll make a note to check for the next version > of Haddock. I imagine we'll move to using Data.Binary anyway, which should > fix any non-portability issues. Hello Simon, I use a 64 bit machine. Was base.haddock on the Haskell website created on a 32 bit machine? > [?] Best wishes, Wolfgang From Malcolm.Wallace at cs.york.ac.uk Tue Mar 6 15:25:02 2007 From: Malcolm.Wallace at cs.york.ac.uk (Malcolm Wallace) Date: Tue Mar 6 15:18:09 2007 Subject: [Haskell] Google summer of code Message-ID: <20070306202502.2cac1f2f.Malcolm.Wallace@cs.york.ac.uk> Google Summer of Code As many of you will already know, Google is running its "Summer of Code" project again this year, and haskell.org is once again going to apply to be a mentoring organisation. Are you a student who would like to earn money for hacking in Haskell? Or are you a non-student who has a cool idea for a coding project but no time to do it yourself? Well, our wiki to gather ideas is now up-and-running again: http://hackage.haskell.org/trac/summer-of-code Add yourself to the list of interested people! There are some ideas still there from last year. Add new ones! Google will start accepting student applications in just over a week's time, but now is the time to start using our own wiki to match up interesting ideas with interested people. The official timeline is as follows: March 12: Mentoring organization application deadline March 14: List of accepted mentoring organizations published March 14: Student application period opens March 24: Student application deadline Interim Period: we review and rank student proposals April 9: List of accepted student applications published Interim Period: Students learn more about their project communities May 28: Students begin coding; Google begins issuing initial payments July 9: Students upload code to code.google.com/hosting; July 16: Google begins issuing mid-term payments August 20: Students upload code to code.google.com/hosting; August 31: Final evaluation deadline; Google begins issuing final payments Regards, Malcolm From goenzoy at web.de Tue Mar 6 17:22:52 2007 From: goenzoy at web.de (Gottfried F. Zojer) Date: Tue Mar 6 17:15:57 2007 Subject: =?iso-8859-15?Q?Re:_[Haskell]_Haskell_Dependency/Installation_of_packa?= =?iso-8859-15?Q?ges_(FilePath/MissingPy)?= Message-ID: <160921926@web.de> > -----Urspr?ngliche Nachricht----- > Von: "Neil Mitchell" > Gesendet: 06.03.07 10:33:11 > An: "Gottfried F. Zojer" > CC: haskell@haskell.org > Betreff: Re: [Haskell] Haskell Dependency/Installation FilePath > Hi > > > Loading package base ... linking ... done. > > [1 of 1] Compiling Main ( C:/ghc/ghc-6.6/filepath-0.11/filepath/Setu > > p.hs, interpreted ) > > Ok, modules loaded: Main. > > *Main> > > You have probably downloaded FilePath, but not installed it. Try: > > cd C:/ghc/ghc-6.6/filepath-0.11/filepath > runhaskell Setup configure > runhaskell Setup build > runhaskell Setup install > > Then attempt the installation of MissingH again. > > Thanks > > Neil > Hallo Neil , Thanks for the advice.Well Filepath was installed and at the end everything looked fine. MissingH installation with (winbuild) was going through.I m further now with MissingPy and its the same symptom.(see compile log) Like on the first attempt with MissingH !? [44 of 46] Compiling System.Path.Glob ( src/System/Path/Glob.hs, dist\build/Syst em/Path/Glob.o ) [45 of 46] Compiling System.Debian.ControlParser ( src/System/Debian/ControlPars er.hs, dist\build/System/Debian/ControlParser.o ) [46 of 46] Compiling System.Debian ( src/System/Debian.hs, dist\build/System/ Debian.o ) C:\ghc\ghc-6.6\bin\ar.exe: creating dist\build\libHSMissingH-0.18.0.a C:\server\missingh_0.18.1\missingh> C:\Python24\missingpy_0.1.0\missingpy>runhaskell Setup configure Setup: Warning: Unknown field 'options-ghc' Setup: Warning: Unknown field 'hidden-modules' Setup: Warning: Unknown field 'extra-libs' Setup: Warning: No license-file field. Configuring MissingPy-0.1.0... configure: Dependency haskell-src-any: using haskell-src-1.0 Setup: cannot satisfy dependency MissingH>=0.9.0 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< C:\Python24\missingpy_0.1.0\missingpy>runhaskell Setup build Setup: Warning: Unknown field 'options-ghc' Setup: Warning: Unknown field 'hidden-modules' Setup: Warning: Unknown field 'extra-libs' Setup: error reading ./.setup-config; run "setup configure" command? C:\Python24\missingpy_0.1.0\missingpy> C:\Python24\missingpy_0.1.0\missingpy>python gencabal.py *** Generating MissingPy.cabal based on these settings *** Please edit MissingPy.cabal if the detected settings are *** incorrect. Include path for Python headers: C:\Python24\include Library paths for Python library: None, C:\Python24\Lib\site-packages Python library name: python2.4 Thanks for any feedback Best regards Gottfried www.wirtschaftswunder.co.uk www.5152.eu From ndmitchell at gmail.com Tue Mar 6 18:34:20 2007 From: ndmitchell at gmail.com (Neil Mitchell) Date: Tue Mar 6 18:27:28 2007 Subject: [Haskell] Re: [Haskell-cafe] Google summer of code In-Reply-To: <20070306202502.2cac1f2f.Malcolm.Wallace@cs.york.ac.uk> References: <20070306202502.2cac1f2f.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <404396ef0703061534vf2cc0c7x604a216b867e2ca3@mail.gmail.com> Hi Malcolm, > Well, our wiki to gather ideas is now up-and-running again: > http://hackage.haskell.org/trac/summer-of-code It appears that you need to be logged in to edit the page, and I couldn't find/guess any appropriate passwords. How do we log in? Thanks Neil From claus.reinke at talk21.com Wed Mar 7 10:36:11 2007 From: claus.reinke at talk21.com (Claus Reinke) Date: Wed Mar 7 10:29:19 2007 Subject: [Haskell] ANNOUNCE: OmegaGB, Haskell Game Boy Emulator References: <6205bd290703010832m30abc3ccr7460786cb99db4bd@mail.gmail.com> Message-ID: <010301c760ce$56c46730$54308351@cr3lt> i've seen no replies to this so far, so just a few brief comments: first, many readers like myself may have skipped this announcement because they aren't currently interested in the specific application. what the announcement didn't say is that there is a small development blog for the project, browsing which might be of interest to haskell hackers and implementers alike. we get so few experience reports, and this project includes modeling a code- interpreting virtual machine with a gui, and providing a gui to the model itself, so it might appeal to non-gamers as well (and it is always nice to hear about haskell being applied to fun projects;-): http://www.mutantlemon.com/omegagb/devlog/ second, calling for help with optimisation is okay, but i doubt that many readers will download a full application to search for possible problems in it (there is always the chance of one of the profiling/debugging projects looking for examples like this, but i don't know whether there are any such projects active right now). you did provide a useful overview of your approach, your problems, and the techniques you've tried so far to resolve them, but that kind of overview might be too abstract to provide concrete tips with any certainty about their usefulness. for example, looking at your overall representation of machine instructions and machine state suggests possible problems with space leaks. the tuples are non-strict, so the updates caused by instructions could possibly accumulate until another instruction needs to inspect the results of those updates. > updateMachineDisplayFrame :: JoypadKeyStates -> > ((RegisterStates, Memory), IrqStates) -> > (Display, ((RegisterStates, Memory), IrqStates)) but if you actually display a representation of the machine state at each step, that alone should force all pending instructions, so perhaps this isn't an issue in the real program. then again, your experience with unboxed arrays suggests that perhaps this is an issue after all. and even if there are no runaway space leaks, repeatedly delaying operations only to have them forced a few moments later might have a negative impact on performance. > I originally started this project to explore whether haskell is really > a capable language in the domain of performance critical applications. > I think that with the right optimizations, OmegaGB will be able to do > real time emulation. Unfortunately, I am not experienced enough to > know what kind of optimizations to use. This is why I am calling out > for help. skimming through your blog, two things come to mind: - the virtual machine for such a device is unlikely to do any operation unless the results are needed, so you probably want your state representations to be strict in all components. depending on how well the strictness analyser fares with your code, that might save some intermediate thunk building - instead of interpreting the machine instructions in executeInstruction, you could implement them directly in your execution monad, eliminating one level of interpretation at each step (ie, there'd be a push :: srtype -> ExecutionAST ()); if you can also switch from lists of instructions to monadic sequences of instructions, there might be further gains from asking ghc to inline the instructions skipping explicit representations, as per the second suggestions, might make extracting debug information slightly more difficult, so you may want to keep the explicit version around, or integrate debugging into your execution monad (just something to keep in mind). oh, lest i forget, there's also: http://www.haskell.org/haskellwiki/Performance just to get some discussion going;-) claus From koen at cs.chalmers.se Wed Mar 7 11:19:57 2007 From: koen at cs.chalmers.se (Koen Claessen) Date: Wed Mar 7 11:13:27 2007 Subject: [Haskell] Fwd: HFL07, student stipend(s) available In-Reply-To: References: Message-ID: <1b30d3c80703070819s4f5495bx4d034b485aee0a44@mail.gmail.com> Workshop on Hardware design and Functional Languages HFL'07, Braga, Portugal, March 24 and 25 (with the ETAPS conferences) Student stipend(s) available, deadline March 13 HFL07 is pleased to announce the availability of one or two stipends for students to attend the workshop. We will give preference to undergraduate or masters students, but will also consider PhD students. The stipend should cover all or part of registration at the workshop, the workshop dinner on sunday night, travel and student accommodation. The student should write a letter to the workshop chairs (hfl07@hflworkshop.org) outlining their costs, other financial support that they have obtained (e.g. from their own university) and why they would like to attend the workshop. They should also include a statement from a teacher or supervisor supporting their case (and including an email address). Deadline for receipt of this application is midnight on tuesday March 13th, UK time. For information on the workshop programme, see http://www.hflworkshop.org/ Information about the ETAPS group of conferences, registration, student rooms etc. is at http://www.di.uminho.pt/etaps07/ Please encourage a good undergrad. or masters student to apply for a stipend and come to the workshop! with best wishes Andy Martin, Carl-Johan Seger and Mary Sheeran From koen at cs.chalmers.se Wed Mar 7 11:19:57 2007 From: koen at cs.chalmers.se (Koen Claessen) Date: Wed Mar 7 11:13:47 2007 Subject: [Haskell] Fwd: HFL07, student stipend(s) available In-Reply-To: References: Message-ID: <1b30d3c80703070819s4f5495bx4d034b485aee0a44@mail.gmail.com> Workshop on Hardware design and Functional Languages HFL'07, Braga, Portugal, March 24 and 25 (with the ETAPS conferences) Student stipend(s) available, deadline March 13 HFL07 is pleased to announce the availability of one or two stipends for students to attend the workshop. We will give preference to undergraduate or masters students, but will also consider PhD students. The stipend should cover all or part of registration at the workshop, the workshop dinner on sunday night, travel and student accommodation. The student should write a letter to the workshop chairs (hfl07@hflworkshop.org) outlining their costs, other financial support that they have obtained (e.g. from their own university) and why they would like to attend the workshop. They should also include a statement from a teacher or supervisor supporting their case (and including an email address). Deadline for receipt of this application is midnight on tuesday March 13th, UK time. For information on the workshop programme, see http://www.hflworkshop.org/ Information about the ETAPS group of conferences, registration, student rooms etc. is at http://www.di.uminho.pt/etaps07/ Please encourage a good undergrad. or masters student to apply for a stipend and come to the workshop! with best wishes Andy Martin, Carl-Johan Seger and Mary Sheeran From dmhouse at gmail.com Wed Mar 7 12:33:01 2007 From: dmhouse at gmail.com (David House) Date: Wed Mar 7 12:26:04 2007 Subject: [Haskell] Re: [Haskell-cafe] Google summer of code In-Reply-To: <20070306202502.2cac1f2f.Malcolm.Wallace@cs.york.ac.uk> References: <20070306202502.2cac1f2f.Malcolm.Wallace@cs.york.ac.uk> Message-ID: On 06/03/07, Malcolm Wallace wrote: > Well, our wiki to gather ideas is now up-and-running again: > http://hackage.haskell.org/trac/summer-of-code We should probably remove projects that were succeessfully completed last year, along with the lists of interested students on every project. -- -David House, dmhouse@gmail.com From john at repetae.net Wed Mar 7 22:22:12 2007 From: john at repetae.net (John Meacham) Date: Wed Mar 7 22:15:13 2007 Subject: [Haskell] method annotations In-Reply-To: <45E976BC.1060408@charter.net> References: <45E8B553.40706@charter.net> <20070302235549.GA3071@localhost.localdomain> <48C91018-32B6-477D-974B-A98331F84158@augustsson.net> <20070303092947.GA5921@localhost.localdomain> <45E976BC.1060408@charter.net> Message-ID: <20070308032212.GB2302@momenergy.repetae.net> On Sat, Mar 03, 2007 at 08:23:08AM -0500, Isaac Dupree wrote: > Unfortunately it would be difficult for the compiler to know that no-one > is going to make an instance that does depend on its argument (as long > as it does not do full-program analysis to determine the layout of data > structures). Maybe there should be some sort of annotation on class > method arguments that are supposed to be ignored, even if only a pragma, > if it would help compilers figure this out. indeed, I have given this some thought too, but not just for whether a type will be unused. my current thinking is something like > class Bits a where > shift :: a -> !Int -> a > > class Eq a where > (==) :: a -> a -> !Bool > > class Typeable a where > getType :: ~a -> TypeRep where '!Int' means that the class is strict in the Int argument. and ~ means it is unused. note, these are not just hints, but actually affect the class translation. shift as above would translate to something ilke > shift :: BitsDict a -> Int -> a > shift bd x i = i `seq` shiftInstance bd x i where shiftInstance selects the appropriate value from the dictionary of course, the real benefit is now that we can do unboxing on class methods! we can treat the above class declaration as if it were class Bits a where shift :: a -> Int# -> a safely and rewrite instance declarations appropriately likewise, the ! on the return value in Eq means that we should unbox it. (this is actually always safe, so perhaps a pragma will do for this, "UNPACK" seems appropriate) for the other case > class Typeable a where > getType :: ~a -> TypeRep would create a method like so > getType :: TypeableDict a -> a -> TypeRep > getType td a = getTypeInstance td (undefined `asTypeOf` a) which causes getType to always throw away its argument, allowing the compiler to make assumptions based on it. another implicit optimization that is going on in my translations above is eta-expansion of the class methods (which is independent of the optimizations given above). this is potentially unsafe, but I have been performing the optimization in jhc without ill effect and with noticable benefit. however, you can specify the "NOETA" pragma in order to suppress this auto-eta-expansion as it does decrease sharing. another option for controlling eta expansion would be something like class Eq a where (==) :: a -> !(a -> Bool) which makes explicit that the partial result of (==) applied to one argument could usefully be shared. currently, these optimization are availabe in jhc, but only via pragmas and some built in heuristics/special knowledge in the compiler. Implementing the above syntax has been on my todo list. Anecdotal examination of core leads me to believe they could be signifigantly beneficial. John -- John Meacham - ?repetae.net?john? From oleg at pobox.com Thu Mar 8 01:48:02 2007 From: oleg at pobox.com (oleg@pobox.com) Date: Thu Mar 8 01:41:59 2007 Subject: [Haskell] ANN: binary arithmetic type library over natural kinds Message-ID: <20070308064802.C94B8AD34@Adric.metnet.fnmoc.navy.mil> Chung-chieh Shan and I would like to announce the type-level Haskell library for arbitrary precision binary arithmetic over natural kinds. The library supports addition/subtraction, predecessor/successor, multiplication/division, exp2, full comparisons, GCD, and the maximum. At the core of the library are multi-mode ternary relations Add and Mul where _any_ two arguments determine the third. Such relations are especially suitable for specifying static arithmetic constraints on computations. The type-level numerals have no run-time representation; correspondingly, all arithmetic operations are done at compile time and have no effect on run-time. http://pobox.com/~oleg/ftp/Computation/resource-aware-prog/BinaryNumber.hs We used the arithmetic type library to statically enforce validity, range, size, and alignment constraints of raw memory pointers, and to statically enforce protocol and time-related constraints when accessing device registers. The following near final full paper http://pobox.com/~oleg/ftp/Computation/resource-aware-prog/tfp.pdf describes the arithmetic type library, type-level records, type-level programming with regular Haskell terms, and two sample applications. We will greatly appreciate all the comments (especially those received before noon on Friday). From droundy at darcs.net Thu Mar 8 11:24:57 2007 From: droundy at darcs.net (David Roundy) Date: Thu Mar 8 11:17:58 2007 Subject: [Haskell] ANN: binary arithmetic type library over natural kinds In-Reply-To: <20070308064802.C94B8AD34@Adric.metnet.fnmoc.navy.mil> References: <20070308064802.C94B8AD34@Adric.metnet.fnmoc.navy.mil> Message-ID: <20070308162454.GA25522@abridgegame.org> On Wed, Mar 07, 2007 at 10:48:02PM -0800, oleg@pobox.com wrote: > > Chung-chieh Shan and I would like to announce the type-level Haskell > library for arbitrary precision binary arithmetic over natural kinds. The > library supports addition/subtraction, predecessor/successor, > multiplication/division, exp2, full comparisons, GCD, and the maximum. > At the core of the library are multi-mode ternary relations Add and Mul > where _any_ two arguments determine the third. Such relations are > especially suitable for specifying static arithmetic constraints on > computations. The type-level numerals have no run-time representation; > correspondingly, all arithmetic operations are done at compile time and > have no effect on run-time. This looks pretty nice, but I'm curious as to whether it can be extended to verify run-time checks? i.e. I'd like to be able to use a natural number determined at run-time to create arrays that are statically bounds-checked. i.e. I'm imagining something like this: data Arr a n = ... -- n is a type-level variable describing the dimension -- a is the data type stored withArrayFromList :: [a] -> (Nat n => Arr a n -> b) -> b which would allow me to initialize an array with static bounds checking, and use it in a function. Of course, to support this we'd also need run-time comparison, add, etc. But what I'm dreaming of is that the type system would enforce those run-time checks when necesary. e.g. catArray :: Add n1 n2 n3 => Arr a n1 -> Arr a n2 -> Arr a n3 I imagine this is harder, but it's needed if these type-level binaries will be useful for the sorts of programs I tend to write--which have run-time sizes. -- David Roundy Department of Physics Oregon State University From g9ks157k at acme.softbase.org Thu Mar 8 16:51:11 2007 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Thu Mar 8 16:44:21 2007 Subject: [Haskell] Summer of Code questions Message-ID: <200703082251.11757.g9ks157k@acme.softbase.org> Hello, I?ve some questions regarding the Haskell.org involvement in the Google Summer of Code. First, what organization is ?Haskell.org?? Is this a real organization, i.e., a legal entity? Does Haskell.org get the $ 500 for each successful project? If yes, what does Haskell.org do with this money? Furthermore, the Google Summer of Code FAQ talks about *the* project of a organization which seems to indicate that each organization has only one SoC project. What is the project of the Haskell.org organization then? Is this the general project ?The Haskell language plus associated libraries and tools?? The FAQ says ?Mentor organizations must be organizations or individuals running an active and viable open source or free software project?. Does this mean that the above-mentioned general project has to be active and viable (which it is) or that each concrete idea has to be part of an active and viable project? That is, is it allowed to start a new concrete project by letting a student code for it as part of the SoC or wouldn?t this be possible since a new project isn?t yet active and viable? Who decides which ideas will be worked on and who decides which student works on which? What are the obligations of a mentor? Is it okay to create an idea, become the mentor for this idea and propose a concrete student for it? What do I have to do to become a mentor? What are Haskell.org?s criteria for selecting mentors? According to the above-mentioned FAQ, Google wants to know these criteria as specifically as possible. Finally, should the ideas chosen so that they are solvable by a student working full time on them during the three months of the SoC? The problem is that at many German universities lectures go until July. At our university, for example, lecture time ends in mid of July and is followed by two weeks for exams. So a faithful student would only have the last month for working full time on the SoC. Thank you very much for any clarifications. Best wishes, Wolfgang From Malcolm.Wallace at cs.york.ac.uk Thu Mar 8 18:11:47 2007 From: Malcolm.Wallace at cs.york.ac.uk (Malcolm Wallace) Date: Thu Mar 8 18:04:50 2007 Subject: [Haskell] Summer of Code questions In-Reply-To: <200703082251.11757.g9ks157k@acme.softbase.org> References: <200703082251.11757.g9ks157k@acme.softbase.org> Message-ID: <20070308231147.6fb28414.Malcolm.Wallace@cs.york.ac.uk> Wolfgang Jeltsch writes: > First, what organization is Haskell.org? That would be us, right here. Anyone who is interested enough in Haskell to be involved in mailing lists, IRC, distributing library code and tools, whatever. > Is this a real organization, i.e., a legal entity? No. (Unlike e.g. the Apache Foundation.) > Does Haskell.org get the $ 500 for each successful project? > If yes, what does Haskell.org do with this money? Yes, we get the money. Last year, Galois kindly served as the account holder that received the cheque. The mentors involved get to decide what happens to it. I think we are planning to spend last year's on machine/bandwidth for hosting hackage.haskell.org. > Furthermore, the Google Summer of Code FAQ talks about *the* project of a > organization which seems to indicate that each organization has only > one SoC project. The model is that an open-source organisation does indeed usually have one focus, e.g. apache, Linux kernel, GTK, Gnome, Python. But of course there can be smaller tools and focuses within each overarching theme. > What is the project of the Haskell.org organization then? Is this > the general project "The Haskell language plus associated libraries and > tools"? Exactly so. > The FAQ says "Mentor organizations must be organizations or individuals > running an active and viable open source or free software project". Does > this mean that the above-mentioned general project has to be active and > viable (which it is) or that each concrete idea has to be part of an active > and viable project? The former. Decisions about concrete ideas are made collectively by the organisation, and we could certainly decide to go for a relatively immature concrete idea, if it looks both viable and of sufficient value to the community as a whole. > That is, is it allowed to start a new concrete project > by letting a student code for it as part of the SoC or wouldn???t this be > possible since a new project isn???t yet active and viable? Yes, you can do. It will have to compete with other ideas for top ranking. > Who decides which ideas will be worked on and who decides which student > works on which? Each organisation (in practice, this means a group of people prepared to be mentors) reads and ranks student proposals. After a certain date, Google tell us how many projects they will fund, and the top N are given the money. > What are the obligations of a mentor? (a) To carefully read and vote on quite a lot of student proposals. (b) If chosen to mentor a funded project, to guide the student throughout the project time, primarily by email (and/or IRC). Also to write two reports on progress (mid-term and final), that directly determine whether the student gets paid. > Is it okay to create an idea, become the mentor for this idea > and propose a concrete student for it? Sure. But your idea and student will need to compete for ranking. > What do I have to do to become a mentor? Start by adding yourself to the wiki. > What are Haskell.org's criteria for selecting mentors? According to the > above-mentioned FAQ, Google wants to know these criteria as specifically as > possible. I'm not sure we have definite criteria. I guess that the community generally recognises your name as a contributor to the Haskell language, libraries, tools, or whatever. Regular and visible engagement with the community would count for a lot. > Finally, should the ideas be chosen so that they are solvable by a student > working full time on them during the three months of the SoC? Exactly so. This year, Google have set things up with a greater time period between notification of acceptance, and the official beginning of coding, so that students have more preparation time before full-time work starts. > The problem is that at many German universities lectures go until > July. At our university, for example, lecture time ends in mid of July > and is followed by two weeks for exams. So a faithful student would > only have the last month for working full time on the SoC. Google have indeed set up the timetable largely with US universities in mind. So yes, it is certainly a disadvantage to a German student that they cannot work full-time for the three months. Regards, Malcolm From g9ks157k at acme.softbase.org Thu Mar 8 18:39:02 2007 From: g9ks157k at acme.softbase.org (Wolfgang Jeltsch) Date: Thu Mar 8 18:32:10 2007 Subject: [Haskell] Summer of Code questions In-Reply-To: <20070308231147.6fb28414.Malcolm.Wallace@cs.york.ac.uk> References: <200703082251.11757.g9ks157k@acme.softbase.org> <20070308231147.6fb28414.Malcolm.Wallace@cs.york.ac.uk> Message-ID: <200703090039.02360.g9ks157k@acme.softbase.org> Hello again, first, thank you, Malcolm, for your answers. Further questions are below. Am Freitag, 9. M?rz 2007 00:11 schrieb Malcolm Wallace: > Wolfgang Jeltsch writes: > > First, what organization is Haskell.org? > > That would be us, right here. Anyone who is interested enough in > Haskell to be involved in mailing lists, IRC, distributing library code > and tools, whatever. > > > Is this a real organization, i.e., a legal entity? > > No. (Unlike e.g. the Apache Foundation.) Doesn?t this create problems in conjunction with the Summer of Code or is Google tolerant regarding the legal status of participating organizations? > [?] > > What are the obligations of a mentor? > > (a) To carefully read and vote on quite a lot of student proposals. > (b) If chosen to mentor a funded project, to guide the student throughout > the project time, primarily by email (and/or IRC). Also to write > two reports on progress (mid-term and final), that directly > determine whether the student gets paid. Hmm, I might be able to do (b) but doing (a) seems to demand more time than I could spend. Is there any possibility to only do (b) for a concrete project I have in mind? > [?] Best wishes, Wolfgang From oleg at pobox.com Thu Mar 8 20:48:25 2007 From: oleg at pobox.com (oleg@pobox.com) Date: Thu Mar 8 20:42:24 2007 Subject: [Haskell] Re: ANN: binary arithmetic type library over natural kinds Message-ID: <20070309014825.DF495AD33@Adric.metnet.fnmoc.navy.mil> David Roundy wrote: > data Arr a n = ... -- n is a type-level variable describing the dimension > -- a is the data type stored > withArrayFromList :: [a] -> (Nat n => Arr a n -> b) -> b > ... > But what I'm dreaming of is that the type system would enforce those > run-time checks when necesary. e.g. > > catArray :: Add n1 n2 n3 => Arr a n1 -> Arr a n2 -> Arr a n3 > > I imagine this is harder, but it's needed if these type-level binaries > will be useful for the sorts of programs I tend to write--which have > run-time sizes. I believe the lightweight static capabilities approach will be more appropriate here. It already provides the function withArrayFromList, which is called `brand'. For example, KMP-deptype.hs includes > -- brand the packed string > brandPS:: PackedString > -> (forall r. (BPackedString r, BIndexP1 r) -> w) -> w -> w which is quite like `withArrayFromList' only using `r' rather that 'n' and with an extra argument which is returned when the source packed string turns out empty. The approach almost fulfills your dream: only, instead of the `system' inserting run-time checks, it is the programmer who inserts the checks, to please the typechecker. In the catArray example, one would write something like that > -- kernel > data Arr a = ... > newtype BArr n a = BArr{unBArr:: Arr a} -- BArr data ctor not exported > brand :: Arr a -> (forall n. (BArr n a, BIx n) -> w) -> w > -- User code > catArray :: BArr n1 a -> BArr n2 a -> Arr a > catArray a1 a2 = concatArr (unBArr a1) (unBArr a2) > test a1 a2 = brand (catArray a1 a2) (\newarray itsbound -> ...) The user can easily write catArray to create an unbranded array. One needs branding however to be able to index into the array: thus one has to invoke brand (the `smart' constructor of the BArr type), which will do the run-time check. The kernel may provide other constructors of BArr from arguments of some particular types, which let us avoid the run-time check. Alas, the style of writing is a bit like CPS -- OTH, we write monadic code, which is CPS in thin disguise, with no complaints... One can use existentials to make the code look more direct-style, however. The programming becomes a bit like theorem proving: the indexing operation needs BArr, so we have to consider all the ways we can get a value of that type. The kernel provides a few constructors; one of which, brand, always applies, but it involves a run-time check. There may be other constructors; but they require arguments of particular types. We should see if we can produce the values of those types from already available values, etc. This is back-chaining theorem proving. From john at repetae.net Thu Mar 8 21:37:07 2007 From: john at repetae.net (John Meacham) Date: Thu Mar 8 21:30:05 2007 Subject: [Haskell] ANN: binary arithmetic type library over natural kinds In-Reply-To: <20070308162454.GA25522@abridgegame.org> References: <20070308064802.C94B8AD34@Adric.metnet.fnmoc.navy.mil> <20070308162454.GA25522@abridgegame.org> Message-ID: <20070309023707.GC10703@momenergy.repetae.net> On Thu, Mar 08, 2007 at 08:24:57AM -0800, David Roundy wrote: > This looks pretty nice, but I'm curious as to whether it can be extended to > verify run-time checks? i.e. I'd like to be able to use a natural number > determined at run-time to create arrays that are statically > bounds-checked. > > i.e. I'm imagining something like this: > > data Arr a n = ... -- n is a type-level variable describing the dimension > -- a is the data type stored > withArrayFromList :: [a] -> (Nat n => Arr a n -> b) -> b I think the ST trick can be done here safely if you change the type to > withArrayFromList :: [a] -> (forall n . Nat n => Arr a n -> b) -> b notice the rank-2 type, this ensures the argument is a function that can work on arrays of any size, without specifying any size in particular at compile time. run time checks would be needed only if you wanted to refine the type: > assertSize4 :: Arr a n -> Maybe Arr a N4 but what is cool is you just need to perform this run-time check once then all your code can work on 'Arr a N4' knowing that it has exactly 4 elements. the type system takes care of propegating the fact you already did the appropriate run-time check for you. quite nice. > which would allow me to initialize an array with static bounds checking, > and use it in a function. Of course, to support this we'd also need > run-time comparison, add, etc. But what I'm dreaming of is that the type > system would enforce those run-time checks when necesary. e.g. > > catArray :: Add n1 n2 n3 => Arr a n1 -> Arr a n2 -> Arr a n3 > > I imagine this is harder, but it's needed if these type-level binaries will > be useful for the sorts of programs I tend to write--which have run-time > sizes. I think this sort of thing will 'just work' unless I am misunderstanding what you want. This all seems very interesting, I would like it if there were a standardish type level arithmetic library in base. though, I find it a little aethetically jarring without user defined kinds like in omega. John -- John Meacham - ?repetae.net?john? From duncan.coutts at worc.ox.ac.uk Thu Mar 8 23:41:37 2007 From: duncan.coutts at worc.ox.ac.uk (Duncan Coutts) Date: Thu Mar 8 23:34:22 2007 Subject: [Haskell] Summer of Code questions In-Reply-To: <200703090039.02360.g9ks157k@acme.softbase.org> References: <200703082251.11757.g9ks157k@acme.softbase.org> <20070308231147.6fb28414.Malcolm.Wallace@cs.york.ac.uk> <200703090039.02360.g9ks157k@acme.softbase.org> Message-ID: <1173415297.1018.695.camel@localhost> On Fri, 2007-03-09 at 00:39 +0100, Wolfgang Jeltsch wrote: > > > First, what organization is Haskell.org? > > > > That would be us, right here. Anyone who is interested enough in > > Haskell to be involved in mailing lists, IRC, distributing library code > > and tools, whatever. > > > > > Is this a real organization, i.e., a legal entity? > > > > No. (Unlike e.g. the Apache Foundation.) > > Doesn?t this create problems in conjunction with the Summer of Code or is > Google tolerant regarding the legal status of participating organizations? It didn't cause any problem last year. > > > What are the obligations of a mentor? > > > > (a) To carefully read and vote on quite a lot of student proposals. > > (b) If chosen to mentor a funded project, to guide the student throughout > > the project time, primarily by email (and/or IRC). Also to write > > two reports on progress (mid-term and final), that directly > > determine whether the student gets paid. > > Hmm, I might be able to do (b) but doing (a) seems to demand more time than I > could spend. Is there any possibility to only do (b) for a concrete project > I have in mind? I think (b) takes more time actually. You have to be able to be available a few hours a week to talk to the student. Over the 3 months, that's a good deal more than the few hours spent initially in the process of ranking student applications. Duncan From dons at cse.unsw.edu.au Thu Mar 8 23:51:45 2007 From: dons at cse.unsw.edu.au (Donald Bruce Stewart) Date: Thu Mar 8 23:44:59 2007 Subject: [Haskell] Summer of Code questions In-Reply-To: <1173415297.1018.695.camel@localhost> References: <200703082251.11757.g9ks157k@acme.softbase.org> <20070308231147.6fb28414.Malcolm.Wallace@cs.york.ac.uk> <200703090039.02360.g9ks157k@acme.softbase.org> <1173415297.1018.695.camel@localhost> Message-ID: <20070309045145.GA3893@cse.unsw.EDU.AU> duncan.coutts: > On Fri, 2007-03-09 at 00:39 +0100, Wolfgang Jeltsch wrote: > > > > > First, what organization is Haskell.org? > > > > > > That would be us, right here. Anyone who is interested enough in > > > Haskell to be involved in mailing lists, IRC, distributing library code > > > and tools, whatever. > > > > > > > Is this a real organization, i.e., a legal entity? > > > > > > No. (Unlike e.g. the Apache Foundation.) > > > > Doesn???t this create problems in conjunction with the Summer of Code or is > > Google tolerant regarding the legal status of participating organizations? > > > It didn't cause any problem last year. Indeed. The majority of .orgs are ad hoc developer groups. Very few are actually legal entitites (like Apach or NetBSD). > > > > What are the obligations of a mentor? > > > > > > (a) To carefully read and vote on quite a lot of student proposals. > > > (b) If chosen to mentor a funded project, to guide the student throughout > > > the project time, primarily by email (and/or IRC). Also to write > > > two reports on progress (mid-term and final), that directly > > > determine whether the student gets paid. > > > > Hmm, I might be able to do (b) but doing (a) seems to demand more time than I > > could spend. Is there any possibility to only do (b) for a concrete project > > I have in mind? > > I think (b) takes more time actually. You have to be able to be > available a few hours a week to talk to the student. Over the 3 months, > that's a good deal more than the few hours spent initially in the > process of ranking student applications. If possible, you would be available for daily discussion via irc, or in person. -- Don From conrad at metadecks.org Fri Mar 9 03:53:01 2007 From: conrad at metadecks.org (Conrad Parker) Date: Fri Mar 9 03:45:58 2007 Subject: [Haskell] Summer of Code questions In-Reply-To: <20070309045145.GA3893@cse.unsw.EDU.AU> References: <200703082251.11757.g9ks157k@acme.softbase.org> <20070308231147.6fb28414.Malcolm.Wallace@cs.york.ac.uk> <200703090039.02360.g9ks157k@acme.softbase.org> <1173415297.1018.695.camel@localhost> <20070309045145.GA3893@cse.unsw.EDU.AU> Message-ID: Hi, just following up from this and some subsequent discussion on #haskell: On 09/03/07, Donald Bruce Stewart wrote: > duncan.coutts: > > On Fri, 2007-03-09 at 00:39 +0100, Wolfgang Jeltsch wrote: > > > > > > > First, what organization is Haskell.org? > > > > > Is this a real organization, i.e., a legal entity? > > > > > > > > No. (Unlike e.g. the Apache Foundation.) > > > > > > Doesn???t this create problems in conjunction with the Summer of Code or is > > > Google tolerant regarding the legal status of participating organizations? > > > > It didn't cause any problem last year. > > Indeed. The majority of .orgs are ad hoc developer groups. Very few are > actually legal entitites (like Apach or NetBSD). Some second-hand info regarding discussion on the mentoring organisation's discussion group (non-public, hence no archive URL): kfish: there was some discussion about umbrella organizations and incorporation kfish: Leslie recommended organizations incorporate, or get the Software Freedom Law Center or SPI to handle their financials for them but I can't find a statement that this was required I think the idea is that if you have a legal footprint, they can pay that, and individuals don't have to go through the hassle of getting a US taxpayer ID number just so they can tell the US gov't they're not taxable As I also mentioned on #haskell, there is probably no problem for haskell.org because it had a successful SoC last year. When I talked with Leslie after linux.conf.au, she mentioned that she was very very happy with haskell.org's participation last year because the people from the Haskell community were so friendly, kind and patient :-) cheers, Conrad (kfish). From hu at mist.i.u-tokyo.ac.jp Fri Mar 9 14:02:37 2007 From: hu at mist.i.u-tokyo.ac.jp (Zhenjiang Hu) Date: Fri Mar 9 13:56:44 2007 Subject: [Haskell] CFP: HLPP 2007 (Tokyo, July 23-24, 2007) Message-ID: <45F1AF4D.6050506@mist.i.u-tokyo.ac.jp> We apologize if you receive multiple copies. --------------------------------------------------------------- Call For Papers Fourth International Workshop on HIGH-LEVEL PARALLEL PROGRAMMING AND APPLICATIONS (HLPP 2007) The University of Tokyo, Tokyo, Japan July 23-24, 2007 http://f.loulergue.free.fr/HLPP/hlpp2007/ --------------------------------------------------------------- AIMS AND SCOPE Bill McColl's post Sequential Computing Considered Harmful is an excellent summary of today's situation (http://www.computingatscale.com). Sequential computing cannot go further. Major companies in the computing industry now recognizes the urgency of reorienting an entire industry towards massively parallel computing. The trend is towards the increase of cores in processors and the need for scalable computing everywhere. But parallel and distributed programming is still dominated by low-level techniques such as send/receive message passing. Thus high-level approaches should play a key role in the shift to scalable computing in every computer. This workshop follows the first three HLPP workshops held in 2001, 2003 and 2005. It is aimed at: - computer science researchers, practitioners, graduate students - scientific computing researchers, practitioners, graduate students - high-performance application developers (e.g. in DBMS, data-mining, parallel model checking, virtual reality) TOPICS We welcome submission of original, unpublished papers in English on topics including (but not limited to) the following aspects of multi-core, concurrent, parallel, distributed, meta and grid computing: - high-level algorithms for parallel, communication-efficient and external-memory computation - high-level programming models (BSP, CGM, LogP, MPM, etc.) and tools - high-level programming models, tools and algorithms for multi-threaded, reconfigurable and multi-core computing - parallel programming methodologies - algorithmic skeletons and constructive methods - performance models and performance evaluation - high level resource-aware approaches object, functional, logic, constraint programming (semantics and implementation) - verification of parallel and distributed programs - security in high-level approaches - applications using high-level languages and tools (scientific computing, DBMS, model-checking, virtual reality, ...) - teaching experience with high-level tools and methods Accepted papers should be presented at the workshop. Revised versions will be published in a special issue of an international journal (previous HLPP workshops were published in Parallel Processing Letters, World Scientific Publishing) provided revisions suggested by the referees are made. IMPORTANT DATES 15 April 2007: Full paper due 28 May 2007: Notification 2 July 2007: Camera-ready paper due 23-24 July 2007: Workshop 17 September 2007: Journal version due PROGRAMME COMMITTEE Manuel Chrakravarty (Univ. of New South Wales, Australia) Murray Cole (Univ. of Edinburgh, UK) Alexandros Gerbessiotis (NJIT, USA) Sergei Gorlatch (Univ. of Muenster, Germany) Zhenjiang Hu (Univ. of Tokyo, Japan) Christoph Kessler (Linkopings Universitet, Sweden) Herbert Kuchen (Univ. of Muenster, Germany) Rita Loogen (Univ. of Marburg, Germany) Frederic Loulergue (Univ. of Orleans, France) Quentin Miller (Somerville College, Oxford, UK) Susanna Pelagatti (Univ. of Pisa, Italy) Alexander Tiskin (Univ. of Warwick, UK) Kazunori Ueda (Waseda University, Japan) CHAIRS AND ORGANIZERS Zhenjiang HU Information Processing Laboratory Department of Mathematical Informatics Department of Mathematical Engineering and Information Physics The University of Tokyo Frederic LOULERGUE Laboratoire d'Informatique Fondamentale d'Orleans Faculty of Sciences Computer Science Department University of Orleans PAST HLPP WORKSHOPS HLPP 2005 was held in Coventry (July 4-5, 2005). HLPP 2003 was held in Paris (June 16-18, 2003). Parallel Processing Letters (Volume 13, issue 3) contains 14 revised papers presented at the workshop. HLPP 2001 was held in Orleans (March 26-27, 2001). Parallel Processing Letters (Volume 11,issue 4) contains 8 revised papers presented at the workshop. From haskell2 at davidb.org Sat Mar 10 14:36:21 2007 From: haskell2 at davidb.org (David Brown) Date: Sat Mar 10 14:29:14 2007 Subject: [Haskell] Announcing harchive-0.2: Backup and restore software in Haskell. Message-ID: <45F308B5.8020601@davidb.org> Announcing release 0.2 of "harchive", a program for backing up and restoring data. I've included a brief feature list below. The code is available in darcs at: http://www.davidb.org/darcs/harchive/ The package is available from hackage at: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/harchive-0.2 This release fixes some serious problems with the 0.1 release. No significant features have been implemented, but the code can now be compiled with '-O' without causing segfaults. Dave Brown ---------------------------------------------------------------------- Harchive version 0.2: - Several changes that change the storage format: - Changed protocol and storage format a bit to not encode lengths with hashes. - Record attributes of root directory. - Fix some problems with multiple threads on the SQL binding. There is still a problem, but by only using one OS thread, it doesn't appear now. Multiple simultaneous clients appear to work. From twanvl at gmail.com Sun Mar 11 15:31:35 2007 From: twanvl at gmail.com (Twan van Laarhoven) Date: Sun Mar 11 15:24:17 2007 Subject: [Haskell] ANNOUNCE: Data.CompactString 0.3 - Unicode ByteString with different encodings Message-ID: <45F45917.1090800@gmail.com> Hello all, I would like to announce version 0.3 of my Data.CompactString library. Data.CompactString is a wrapper around Data.ByteString that represents a Unicode string. This new version supports different encodings, as can be seen from the data type: > data Encoding a => CompactString a Currently the following encodings are supported: - UTF-8, UTF-16 and UTF-32 (both big and little endian) - ASCII - ISO-8859-1 (latin1) - A custom compact encoding Conversion between different encodings, and between CompactStrings and ByteStrings is possible. There are also functions to automatically detect the encoding of files based on a byte order mark. Just this part of CompactString could be used as an encoding library for ByteStrings. In addition to overloaded functions like > length :: Encoding a => CompactString a -> Int, there are also modules Data.CompactString.UTF8, Data.CompactString.UTF16, etc. which are restricted to a single encoding: > length :: CompactString UTF8 -> Int I expect that these will be more useful in most cases. The library is now feature complete, but it has not been optimized yet. There are also some problems with I/O functions, since it is difficult to determine what kind of encoding should be used given a Handle. Homepage: http://twan.home.fmf.nl/compact-string/ Haddock: http://twan.home.fmf.nl/compact-string/doc/html/ Source: darcs get http://twan.home.fmf.nl/repos/compact-string Twan van Laarhoven From Dave at haskell.org Sun Mar 11 16:23:51 2007 From: Dave at haskell.org (Dave@haskell.org) Date: Sun Mar 11 16:16:39 2007 Subject: [Haskell] Type problems Message-ID: <20070311201638.3099F32433C@www.haskell.org> I am stumped trying to print values returned from IO functions. How to print values returned from getEnv and getEnvironment? Thanks, Dave Feustel From bulat.ziganshin at gmail.com Sun Mar 11 17:53:56 2007 From: bulat.ziganshin at gmail.com (Bulat Ziganshin) Date: Sun Mar 11 17:51:35 2007 Subject: [Haskell] Type problems In-Reply-To: <20070311201638.3099F32433C@www.haskell.org> References: <20070311201638.3099F32433C@www.haskell.org> Message-ID: <171095293.20070312005356@gmail.com> Hello Dave, Sunday, March 11, 2007, 11:23:51 PM, you wrote: > I am stumped trying to print values returned from IO functions. > How to print values returned from getEnv and getEnvironment? don't try to print them. just realize that they are not exist :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com From dons at cse.unsw.edu.au Sun Mar 11 18:37:44 2007 From: dons at cse.unsw.edu.au (Donald Bruce Stewart) Date: Sun Mar 11 18:30:39 2007 Subject: [Haskell] Type problems In-Reply-To: <20070311201638.3099F32433C@www.haskell.org> References: <20070311201638.3099F32433C@www.haskell.org> Message-ID: <20070311223744.GA14161@cse.unsw.EDU.AU> Dave: > I am stumped trying to print values returned from IO functions. > How to print values returned from getEnv and getEnvironment? > import System.Environment main = do args <- getArgs env <- getEnvironment print args print env You evaluate the IO action, extracting its result. $ ./a.out hello ["hello"] [("PATH","/home/dons/bin:/home/dons/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/home/dons/bin:/sbin:/usr/sbin:/usr/local/sbin").... Note that the do notation is just syntactic sugar for the >>= function, getArgs >>= \ args -> getEnvironment >>= \ env -> print args >> print env It's probably a good idea to read up on monadic IO at some point. The best references are: http://darcs.haskell.org/yaht/yaht.pdf http://en.wikibooks.org/wiki/Haskell Also, a lot of articles here: http://haskell.org/haskellwiki/Blog_articles -- Don P.S. Best asked on the irc channel, you'll get a faster response :-) From keller at cse.unsw.edu.au Sun Mar 11 19:19:30 2007 From: keller at cse.unsw.edu.au (Gabriele Keller) Date: Sun Mar 11 19:12:26 2007 Subject: [Haskell] Haskell Workshop Call for Papers Message-ID: <1173655171.13131.64.camel@localhost.localdomain> My apologies if you receive multiple copies of this: ------------------------------------------------------------------------- ACM SIGPLAN 2007 Haskell Workshop Call for Papers Freiburg, Germany 30 September, 2007 The Haskell Workshop 2007 will be part of the 2007 International Conference on Functional Programming (ICFP) as an associated, ACM SIGPLAN sponsored workshop. Previous Haskell Workshops have been held in La Jolla (1995), Amsterdam (1997), Paris (1999), Montreal (2000), Firenze (2001), Pittsburgh (2002), Uppsala (2003), Snowbird (2004), Tallinn (2005), and Portland, Oregon (2006) Topics The purpose of the Haskell Workshop is to discuss experience with Haskell, and possible future developments for the language. The scope of the workshop includes all aspects of the design, semantics, theory, application, implementation, and teaching of Haskell. Topics of interest include, but are not limited to, the following: * Language Design, with a focus on possible extensions and modifications of Haskell as well as critical discussions of the status quo; * Theory, in the form of a formal treatment of the semantics of the present language or future extensions, type systems, and foundations for program analysis and transformation; * Implementations, including program analysis and transformation, static and dynamic compilation for sequential, parallel, and distributed architectures, memory management as well as foreign function and component interfaces; * Tools, in the form of profilers, tracers, debuggers, pre-processors, and so forth; * Applications, Practice, and Experience with Haskell for scientific and symbolic computing, database, multimedia and Web applications, and so forth as well as general experience with Haskell in education and industry; * Functional Pearls being elegant, instructive examples of using Haskell. Papers in the latter two categories need not necessarily report original research results; they may instead, for example, report practical experience that will be useful to others, re-usable programming idioms, or elegant new ways of approaching a problem. The key criterion for such a paper is that it makes a contribution from which other practitioners can benefit. It is not enough simply to describe a program! Submission details Submission Deadline: Friday, June 15th 2007 Author Notification: Monday, July 16th 2007 Final Submission: Friday, August 3rd 2007 Submitted papers should be in postscript or portable document format, formatted using the ACM SIGPLAN style guidelines (http://www.acm.org/sigs/sigplan/authorInformation.htm). The length is restricted to 12 pages. Detailed submission instructions will be available at http://haskell.org/haskell-workshop/2007. Accepted papers will be published by the ACM and will appear in the ACM Digital Library. If there is sufficient demand, we will try to organise a time slot for system or tool demonstrations. If you are interested in demonstrating a Haskell related tool or application, please send a brief demo proposal to Andres Loeh (loeh at informatik.uni-bonn.de). Program Committee * Lennart Augustsson, Credit Suisse, UK * Derek Dreyer, Toyota Technological Institute at Chicago, US * Patricia Johann, Department of Computer Science, Rutgers University, US * Gabriele Keller, School of Computer Science and Engineering, University of New South Wales (Program Chair), Australia * Andy Gill, Galois, US * Stephanie Weirich , School of Engineering and Applied Science, University of Pennsylvania, US * Ganesh Sittampalam, Credit Suisse, UK * Ross Patterson, Programming Languages and Systems Group, City University London, UK * Doaitse Swierstra, Department of Computer Science, Utrecht University, The Netherlands * Chung-chieh Shan, Department of Computer Science, Rutgers University, US -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Dr. Gabriele Keller, Senior Lecturer Tel: +61-2-9385-6032 School of Computing Sciences & Engineering Fax: +61-2-9385-5995 University of New South Wales NSW 2052 Australia From dons at cse.unsw.edu.au Sun Mar 11 22:52:21 2007 From: dons at cse.unsw.edu.au (Donald Bruce Stewart) Date: Sun Mar 11 22:45:11 2007 Subject: [Haskell] Haskell Weekly News: March 12, 2007 Message-ID: <20070312025221.GB15395@cse.unsw.EDU.AU> --------------------------------------------------------------------------- Haskell Weekly News http://sequence.complete.org/hwn/20070312 Issue 59 - March 12, 2007 --------------------------------------------------------------------------- Welcome to issue 59 of HWN, a weekly newsletter covering developments in the [1]Haskell community. This week we see the 2007 Haskell Workshop announcement, Haskell.org's participation in the Google Summer of Code gets underway, and of course, new libraries! 1. http://haskell.org/ Announcements Google Summer of Code and Haskell.org. Malcolm Wallace [2]announced that Haskell.org has once again applied to be a mentoring organisation for the Google Summer of Code. If you are a student who would like to earn money hacking in Haskell, or you are a non-student who has a cool idea for a coding project but no time to do it yourself, then visit the [3]SoC wiki to gather ideas, and add yourself to the list of interested people! Add new ideas for projects! 2. http://article.gmane.org/gmane.comp.lang.haskell.cafe/20232 3. http://hackage.haskell.org/trac/summer-of-code Haskell Workshop Call for Papers. Gabriele Keller [4]announced the initial call for papers for the Haskell Workshop 2007, part of the 2007 International Conference on Functional Programming (ICFP). The purpose of the Haskell Workshop is to discuss experience with Haskell, and possible future developments for the language. The scope of the workshop includes all aspects of the design, semantics, theory, application, implementation, and teaching of Haskell. 4. http://article.gmane.org/gmane.comp.lang.haskell.general/14977 Data.CompactString 0.3: Unicode ByteString. Twan van Laarhoven [5]announced version 0.3 of the Data.CompactString library. Data.CompactString is a wrapper around Data.ByteString supporting Unicode strings. 5. http://article.gmane.org/gmane.comp.lang.haskell.general/14973 harchive-0.2: backup and restore software in Haskell. David Brown [6]announced release 0.2 of [7]harchive, a program for backing up and restoring data. The package is available [8]from Hackage. 6. http://article.gmane.org/gmane.comp.lang.haskell.general/14972 7. http://www.davidb.org/darcs/harchive/ 8. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/harchive-0.2 New release of regex packages. Chris Kuklewicz [9]announced new versions of the regex-* packages (base,compat,dfa,parsec,pcre,posix,tdfa,tre). There is a new [10]wiki page with documentation relating to these packages. All packages are available from [11]Hackage, under the [12]Text Category. 9. http://article.gmane.org/gmane.comp.lang.haskell.cafe/20189 10. http://haskell.org/haskellwiki/Regular_expressions 11. http://hackage.haskell.org/packages/hackage.html 12. http://hackage.haskell.org/packages/archive/pkg-list.html#cat:Text StaticDTD: type safe markup combinators from DTDs. Marcel Manthe [13]announced a tool that transforms a Document Type Definition to a library. The resulting library contains combinators that assure proper nesting of elements. The plan is to add more constraints that will also take care of the order of occurrence of children. The parsing of the DTD is done with HaXml. The code is [14]available via darcs. 13. http://article.gmane.org/gmane.comp.lang.haskell.cafe/20218 14. http://m13s07.vlinux.de/darcs/StaticDTD/ IPv6 support for network package. Bryan O'Sullivan [15]announced that he'd added IPv6 support to the network package. 15. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6363 Type-level binary arithmetic library. Oleg Kiselyov and Chung-chieh Shan [16]announced a [17]new library for arbitrary precision binary arithmetic over natural kinds. The library supports addition/subtraction, predecessor/successor, multiplication/division, exp2, full comparisons, GCD, and the maximum. At the core of the library are multi-mode ternary relations Add and Mul where any two arguments determine the third. Such relations are especially suitable for specifying static arithmetic constraints on computations. The type-level numerals have no run-time representation; correspondingly, all arithmetic operations are done at compile time and have no effect on run-time. 16. http://article.gmane.org/gmane.comp.lang.haskell.general/14961 17. http://pobox.com/~oleg/ftp/Computation/resource-aware-prog/BinaryNumber.hs Haskell' This section covers the [18]Haskell' standardisation process. * [19]Deriving Functor 18. http://hackage.haskell.org/trac/haskell-prime 19. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2135 Libraries This week's proposals and extensions to the [20]standard libraries. * [21]Add IPv6 support to network library * [22]Error handling conventions 20. http://haskell.org/haskellwiki/Library_submissions 21. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6377 22. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6382 Discussion Avoiding intermediate data structures. David Roundy [23]opened discussion on techniques for avoiding intermediate data structures in Haskell code 23. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/20319 Maybe a different Maybe. Joachim Breitner [24]wondered about avoiding intermediate Maybe constructs 24. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/20300 Blog noise [25]Haskell news from the blogosphere. * [26]STM, IO, and a Simple Persistence Model * [27]Dynamic programming in Haskell * [28]Collected 'good math/bad math' Haskell articles * [29]3 open questions about monads * [30]Documentation, libraries and speed matter * [31]Why monads matter * [32]Design Patterns in Haskell: bracket * [33]Practical Haskell: shell scripting with error handling and privilege separation * [34]Simple socket programming * [35]'interact' for TCP sockets * [36]Monads in C, part 3 * [37]Directory tree printing in Haskell. Part 2 * [38]Monads through Pictures * [39]Notes on hacking Haskell * [40]Wanted: Haskell Programmer * [41]Why Publish CS Papers Without Code? * [42]The 8 ways to report errors in Haskell 25. http://planet.haskell.org/ 26. http://mult.ifario.us/articles/2007/03/04/stm-and-io 27. http://sequence.complete.org/node/263 28. http://scienceblogs.com/goodmath/goodmath/programming/haskell/ 29. http://www.randomhacks.net/articles/2007/03/05/three-things-i-dont-understand-about-monads 30. http://kawagner.blogspot.com/2007/03/why-do-most-people-seem-to-use-inferior.html 31. http://www.rfc1149.net/blog/2007/03/06/why-monads-matter/ 32. http://notes-on-haskell.blogspot.com/2007/03/design-patterns-in-haskell-bracket.html 33. http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/06#programmable-semicolons 34. http://metavar.blogspot.com/2007/03/simple-socket-programming.html 35. http://stephan.walter.name/blog/computers/programming/haskell/interacttcp.html 36. http://sigfpe.blogspot.com/2007/03/monads-in-c-pt-iii.html 37. http://blog.moertel.com/articles/2007/03/07/directory-tree-printing-in-haskell-part-two-refactoring 38. http://www.bolour.com/papers/monads-through-pictures.html 39. http://metavar.blogspot.com/2007/03/haskell-hacking-notes-or-prelude-to.html 40. http://blogs.teamb.com/craigstuntz/archive/2007/03/09/WantedHaskellDeveloper.aspx 41. http://billmill.org/why_no_code 42. http://www.randomhacks.net/articles/2007/03/10/haskell-8-ways-to-report-errors Quotes of the Week * fishkandy: The problem with comparing apples to apples is that haskell has 'mango daiquiri' as a basic fruit * fax--: I wake up with a headache because of you, Haskell * norpan: I use functions, but i don't use them as arrows: I prefer silver bullets * ray: Some people claim everything is lisp. One time I was eating some spaghetti and someone came by and said: 'Hey, nice lisp dialect you're hacking in there' * roconnor: Damn it! Haskell pseudo code is indistinguishable from actual code * shapr: Today's nifty error message: *Main> thread blotttchhhkrrreeeedaaa dddinbbbdllleooofcccikkkneeeidddt eiiilnnnydddeeefffiiinnniiittteeelllyyy * stepcut: C? isn't that some low-level language that compilers output to? * wkh: Why does the haskell webpage link to 'research papers' under the 'getting started' section? Code Watch Tue Mar 6 06:31:12 PST 2007. Simon Marlow. [43]add noDuplicate#. This primop ensures that the current computation is not being duplicated, by calling threadPaused(). The idea is to use it inside unsafePerformIO/unsafeInterleaveIO (see #986). 43. http://article.gmane.org/gmane.comp.lang.haskell.cvs.ghc/19536 About the Haskell Weekly News Each week, new editions are posted to [44]the Haskell mailing list as well as to [45]the Haskell Sequence and [46]Planet Haskell. [47]RSS is also available, and headlines appear on [48]haskell.org. Headlines are available as [49]PDF. To help create new editions of this newsletter, please see the [50]contributing information. Send stories to dons at cse.unsw.edu.au. The darcs repository is available at darcs get [51]http://www.cse.unsw.edu.au/~dons/code/hwn 44. http://www.haskell.org/mailman/listinfo/haskell 45. http://sequence.complete.org/ 46. http://planet.haskell.org/ 47. http://sequence.complete.org/node/feed 48. http://haskell.org/ 49. http://www.cse.unsw.edu.au/~dons/code/hwn/archives/20070312.pdf 50. http://haskell.org/haskellwiki/HWN 51. http://www.cse.unsw.edu.au/~dons/code/hwn From luecke at informatik.uni-bremen.de Mon Mar 12 11:40:28 2007 From: luecke at informatik.uni-bremen.de (Dominik Luecke) Date: Mon Mar 12 11:33:20 2007 Subject: [Haskell] Transformation of boolean formulas Message-ID: <45F5746C.7080505@informatik.uni-bremen.de> Hello, although I have subscribed to the Haskell mailing list, my messages are automatically rejected when I try to send a mail to Haskell Regards, Dominik -- Dominik Luecke Phone +49-421-218-64265 Dept. of Computer Science Fax +49-421-218-9864265 University of Bremen luecke@tzi.de P.O.Box 330440, D-28334 Bremen PGP-Key ID 0x2D82571B From luecke at informatik.uni-bremen.de Mon Mar 12 11:53:31 2007 From: luecke at informatik.uni-bremen.de (Dominik Luecke) Date: Mon Mar 12 11:46:23 2007 Subject: [Haskell] Transformation of boolean formulas In-Reply-To: <404396ef0703120844u3e44130cve558479a409880ea@mail.gmail.com> References: <45F5746C.7080505@informatik.uni-bremen.de> <404396ef0703120844u3e44130cve558479a409880ea@mail.gmail.com> Message-ID: <45F5777B.3040607@informatik.uni-bremen.de> Sorry for the copy and paste error... Neil Mitchell schrieb: > Hi Dominik > >> although I have subscribed to the Haskell mailing list, my messages are >> automatically rejected when I try to send a mail to Haskell > > Not anymore! > > And btw, if you want to discuss transformation of boolean formulas, > rather than announce a package that does them, haskell-cafe is > probably a better choice. > > Thanks > > Neil -- Dominik Luecke Phone +49-421-218-64265 Dept. of Computer Science Fax +49-421-218-9864265 University of Bremen luecke@tzi.de P.O.Box 330440, D-28334 Bremen PGP-K