Hello Peter,
cabal.exe is locatated in extralibs\bin. On my machine the installer
added this directory to the PATH, too.
Regards,
Martin.
Peter J. Veger schrieb:
I just installed the Haskell Platform 2009.2.0.2 on Windows.
There is no cabal.exe, only Cabal-1.6.0.3
How to continue: build c
Hello José,
I've done a similar task some weeks ago and I used the Haskell XML
Toolbox (hxt) [1] to do this. After learning how to program with arrows
it was quite easy to write arrows that extract the relevant information
from XML data.
Regards,
Martin.
[1] http://hackage.haskell.org/pack
Hi Andrew,
you will find it there but it's written in German.
http://opus.kobv.de/tuberlin/volltexte/2008/1755/
Regards,
Martin.
Andrew Hunter schrieb:
2009/7/1 Matthias Görgens :
As a side note, (allowing seq and unsafePerformIO if necessary) is it
possible to implement a map that preserve
Hi Haskellers,
I've installed the newest Haskell Platform under Vista and downloaded a
pre compiled version of curl-7.19.4 for MinGW. After changing the build
type in curl.cabal to Simple and supplying the needed paths I could even
build and install curl for haskell.
If I write a program usi
Adrian Neumann schrieb:
Hello,
I'm trying to prove the unfold fusion law, as given in the chapter
"Origami Programming" in "The Fun of Programming". unfold is defined
like this:
unfold p f g b = if p b then [] else (f b):unfold p f g (g b)
And the law states:
unfold p f g . h = unfold p'
Dear Günther,
the map can't be consumed while it is constructed. At any point during
its construction you don't know for any key in the map if it will appear
in the not cosumed rest of the list again. This means you can't process
any entry of the map because it may change later. The only point
Hi,
you could do something like
> instance (Show a,Read a) => Binary a where
> put = put . show
> get = fmap read get
But then you will need the following language extensions:
FlexibleInstances, OverlappingInstances, UndecidableInstances
I don't know how safe this is but it seems to work.
ChrisK schrieb:
Bulat is right about making Block's fields strict.
-- | Get the offsets between entries in a list
getSizes :: [Integer] -> [Integer]
getSizes (x:y:[]) = [y - x]
getSizes (x:y:ys) = (y - x):(getSizes (y:ys))
You should change the first part to add maxSize:
> getSizes :: [In
Hello again,
I found another problem I dont understand:
evalOp :: Op -> (Integer -> Integer -> Integer)
evalOp op = case op of
Plus -> (+)
Minus -> \x y -> max 0 (x-y)
Times -> (*)
brings a parse error, too:
Interpreter.hs:92:3: Parse failure, Parse error in expression: DVar
[Ident
Hello Haskellers,
I've got the following piece of code
type Memory addr value = Map.Map addr value
type Stack item = [item]
data MachineState addr value item = MachineState
{ memory :: Memory addr value
, stack :: Stack item
}
deriving (Show)
newtype Machine addr value item m a =
Hello haskell-cafe,
trying to install ghci-haskeline I got the following error message:
$ cabal install ghci-haskeline
Resolving dependencies...
cabal.exe: dependencies conflict: ghc-6.10.1 requires process ==1.0.1.1
however
process-1.0.1.1 was excluded because ghc-6.10.1 requires process ==1.0
If you use a newtype the answer to the second question is yes. Just put
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
in the first line of your module or pass -XGeneralizedNewtypeDeriving to
ghc or ghci.
Daryoush Mehrtash schrieb:
What happens when a type adds driving such as:
newtype SupplyT
BTW, the documentation of catch is bad: the example
catch (openFile f ReadMode)
(\e -> hPutStr stderr ("Couldn't open "++f++": " ++ show e))
does not type check. Is this a known "bug" or shall I report it anywhere?
Regards,
Martin.
Ross Mellgren schrieb:
I think catch is now basica
Hi all,
when I try to install curl (needed for hxt) using "cabal install curl" I
alwas get the following error message:
Resolving dependencies...
'curl-1.3.2.1' is cached.
Configuring curl-1.3.2.1...
cabal: Error: some packages failed to install:
curl-1.3.2.1 failed during the configure step.
Hi Cetin,
what you seem to want is
> warn :: String -> IO Int
> warn = (return 1 <<) . putStrLn
Cetin Sert schrieb:
> warn :: String → IO Int
> warn = return 1 << putStrLn-- causes an error
> -- = \msg → return 1 << putStrLn msg -- works just fine
> -- = \msg → putStrLn msg >> re
On 21 sep 2008, at 12:11, Martin Huschenbett wrote:
Hi Chris,
thanks for the updated example. Compiling works now. But when I try to
run it I alway get error messages like
["input0 is not in the data","input1 is not in the data"]
Regards,
Martin.
Chris Eidhof schrieb:
Hi Chris,
thanks for the updated example. Compiling works now. But when I try to
run it I alway get error messages like
["input0 is not in the data","input1 is not in the data"]
Regards,
Martin.
Chris Eidhof schrieb:
Hey Martin,
On 19 sep 2008, at 04:14, Martin H
Hi all,
I found a blog post concerning formlets [1] in the web. Since looks very
interesting I tried to compile the sample code with recent versions of
HAppS and formlets from hackage. But this didn't work as the API of
formlets has changed since this post.
I tried to adopt the code to the n
Hi,
I got your tutorial working. But when running it from ghci an exception
raises:
*** Exception: _local/_state\current-00:
openBinaryFile: invalid argument (Invalid argument)
But I found a way to fix this: replace
runserver 5001
by
withProgName "happs-tutorial" $ runserver
Hi all,
taking a look at this tutorial under Windows Vista I ran into a problem:
happs-tutorial depends on HAppS-state which again depends on the unix
package which doesn't work under windows.
So my question is: is there another way to compile HAppS-State and
happs-tutorial on windows?
Reg
Tim Walkenhorst schrieb:
runX $ constA (request TableListRequest) >>> root [] [writeA] >>>
writeDocument [(a_indent,v_1)] "-"
writeDocument [(a_indent,v_1), (a_check_namespaces, v_1)] "-"
should do the trick.
a_check_namespaces unfortunately didn't do the trick. But using
uniqueName
Hi all,
I'm currently trying to generate XML documents with HXT. Everything went
well but I can't figure out how to generate the "xmlns:..." attributes
for the namespaces.
My code looks like:
runX $ constA (request TableListRequest) >>> root [] [writeA] >>>
writeDocument [(a_indent,v_1
Chris Kuklewicz schrieb:
Martin Huschenbett wrote:
1) type MyMonad = ErrorT E (RWST R W S IO)
2) type MyMonad = RWST R W S (ErrorT E IO)
So (1) gives (Left e,s,w) or (Right a,s,w)
and (2) gives (Left e) or (Right (a,s,w))
Due to this fact i decided to use (1). If the operation fails and I
Hi all,
for my current project I need a monad that is an instance of MonadIO,
MonadReader, MonadWriter, MonadState, and MonadError. I see two ways for
defining such a monad using the mtl.
1) type MyMonad = ErrorT E (RWST R W S IO)
and
2) type MyMonad = RWST R W S (ErrorT E IO)
I can't figu
Martin Huschenbett schrieb:
My thoughts were that for any class C the types
> Maybe (forall a. C a => a) (I will call it T1 for short)
and
> (forall a. C a => Maybe a) (I will call it T2 for short)
are isomorphic. Defining the isomorphism from T1 to T2 is quite simple:
i
apfelmus schrieb:
For me, the fourth trial works, at least on
f :: (forall s . Num s => Maybe s) -> Int
f y = case y of
Just x -> x
Nothing -> 0
This works, because the compiler knows that x has to have type Int. But
if you want to apply a function g :: (forall a. Num
Hi again,
the solutions/proposals of Ian and Iavor seem to be exactly what I need
at a first glance. But looking at them more in detail reveals some other
problems.
I also have got a function
> getFieldValueMB :: SqlBind s => Statement -> String -> Maybe s
To get Ians approach working I wou
Ian Lynagh schrieb:
readValue' :: Field -> Maybe (forall s. SqlBind s => s) -> Value
readValue' fld s =
if isJust s then readValue fld (fromJust s) else emptyValue fld
Thank you very much, that's exactly what I wanted. After reading in the
GHC users guide about rank 2 polymorphism I thoug
Hi,
I'm writing some database code using HSQL and had to stop on a problem
with rank-2-polymorphism that I can't solve. The essence of my code is:
module Value where
import Data.Maybe
class SqlBind a where
fromSqlValue :: String -> a
data Field
data Value
emptyValue :: Field -> Value
em
Hi,
instead of writing a function getTransaction that retrieves the
connection you could write a function withConnection that doesn't return
the connection itself but performs an operation on the connection:
withConnection ::
(forall c. Connection c => c -> Transaction a) -> Transacti
Hi,
I've often got the same pattern with nested Maybes but inside the IO
monad (sure this could be every other monad too). Assuming that I've got
functions:
getInput :: IO (Maybe Input)
processInput :: Input -> IO (Maybe Result)
printError :: IO ()
printResult :: Result -> IO ()
I observed m
Hi,
I am new to haskell, and now working on embedding haskell into html.
Thus we will write webapp using haskell as server-side language like
php. Here I explain my plan and ask some questions, looking for
experienced ones to discuss with.
Maybe you should look at
http://www.haskell.org/haske
Hi,
It's probably eaiser to work with normal lists:
listChars :: IO [Char]
listChars = do
c <- getChar
if c == 'q'
then return c
else liftM2 (:) (return c) listChars
But that is not lazy any more, is it? The idea of the OT was, I think,
that he can use the first elements of the li
Hi,
my aim is to transform an XML file into C++ source code with a Haskell
program. The part that parses the XML is already finished (using HaXML)
but the part that generates the C++ code is still remaining. Is there
already any work on this topic? Maybe even on generating Java or any
other o
I just started some multithreaded programming and as I am
a newbie, I've gat a question.
1.) What are the differences between IORefs and MVars?
2.) What are CVars for?
Thanks, Martin.
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.or
> "-fffi" three fs
This time I also get an error:
martin:~/work/prograemmelchen> ghc -fffi -o myprog Main.hs cfile.o
ghc-5.02.2: unrecognised flag: -fffi
Usage: For basic information, try the `--help' option.
Main.hs looks like:
module Main ( main ) where
foreign import ccall "cfun" cfun ::
>
> $ ghc -ffi -o myprog Main.hs cfile.o
>
When I try this I also get an error:
martin:~/work/prograemmelchen> ghc -ffi -o myprog Main.hs cfile.o
ghc-5.02.2: unrecognised flag: -ffi
Usage: For basic information, try the `--help' option.
Do I use a wrong GHC version?
THX, Martin.
_
Hi all,
I've got a simple question concerning FFI but as I am a newbie I don't know the answet.
I've got a C-source-file, maybe something like:
//cfile.c
void cfun()
{
/*
...
do something
...
*/
}
//EOF
and a Haskell-source-File, maybe something like:
Hi all,
does anybody know how to read a single image from a video4linux device under Haskell?
Thanks for all help,
Martin
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi!
Is there meanwhile any tutorial on GTK-HS?
Huschi
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hi all together!
Is there any newer version of HDirect than 0.17? Maybe an CVS-repository?
THX, Huschi!
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
41 matches
Mail list logo