I am trying to learn to use the wx packages to make GUI programs in Haskell with the following code:
module Main where
import Graphics.UI.WX
gui :: IO ()
gui = do
f <- frame [text :="Hello World!"]
staticText f [text :="Some static text"]
return ()
main :: IO()
main = start gui
But when I try to compile this I get the following ...
I'm still new and trying to create a list for use in a function and want to keep it as small as possible which happens to be logBase x y.
but I'm having trouble getting logBase into something I can use in this list.
[1 .. (logBase x y)]
Any suggestions?
...
If you've bought into the functional programming paradigm, the chances are that you like both Erlang and Haskell. Both have purely functional cores and other goodness such as lightweight threads that make them a good fit for a multicore world. But there are some differences too.
Erlang is a commercially proven fault-tolerant language ...
I know I already have the Haskell Data.ByteString.Lazy function to split a CSV on a single character, such as:
split :: Word8 -> ByteString -> [ByteString]
But I want to split on a multi-character ByteString (like splitting on a String instead of a Char):
split :: ByteString -> ByteString -> [ByteString]
I have multi-character sepa...
Where can I find sample projects developed in Haskell?
I am not looking for oogiboogi teta panta sigma functor higher order amusements for Haskell fanboys and academic geekiiii.
For example I have developed a tool for reading IIS log files and generating some CSV-like files and then import them into SQL Server (in C# 3.0) or
A calcul...
I've just started playing around in Haskell. After years of Ruby, I got used to a file organization that's used by Ruby on Rails or Rugui.
Are there any guidelines, best practices, or maybe even frameworks about file-organization in Haskell programs?
("Learn you a Haskell" & "Real World Haskell" don't really handle this issue.)
...
Hey i just installed leksah and tried to run it. But I got a error message "Now updating metadata ...
ide: internal IDE error: FileUtils>>getSysLibDir failed"
anyone knows how to fix that?
...
When compiling a haskell source file via ghc --make foo.hs GHC always leaves behind a variety of intermediate files other than foo.exe. These are foo.hi and foo.o.
I often end up having to delete the .hi and .o files to avoid cluttering up the folders.
Is there a command line option for GHC not to leave behind its intermediate files? (...
Trying to get a feel for haskell.
Am a seasoned programmer with PHP, JAVA, VB and many other languages, but am finding haskell slightly more difficult to follow.
Can anyone give me an english translation for the following haskell function, to get me started...
quicksort [] = []
quicksort (x:xs) = quicksort [y | y <- xs, y<x ]
...
Hi
I have this complex iterations program I wrote in TI Basic to perform a basic iteration on a complex number and then give the magnitude of the result:
INPUT “SEED?”, C
INPUT “ITERATIONS?”, N
C→Z
For (I,1,N)
Z^2 + C → Z
DISP Z
DISP “MAGNITUDE”, sqrt ((real(Z)^2 + imag(Z)^2))
PAUSE
END
What I would like to do is make a Haskell versio...
I have this simple code:
import Network
main = return ()
executing it with runhaskell fails:
>runhaskell test.hs
test.hs: C:\ghc\ghc-6.10.4\network-2.2.1.2\HSnetwork-2.2.1.2.o: unknown symbol `_getnameinfo'
test.hs: test.hs: unable to load package `network-2.2.1.2'
GHCi also gives simillar error message. What can I do about it?
I ...
I'm trying to do the exercises in Real World Haskell in a TDD fashion, using HUnit. As you probably guessed I haven't gotten far yet so I'm an absolute beginner when it comes to Haskell. Given the following code how can I resolve the following error ghci produces:
Ambiguous type variable a' in the constraints:
Show a'
...
Hi,
I am attempting to make an algorithm to solve question 255 at Project Euler
I came up with this solution:
roundedSq n | (roundedSq n) == roundedSq (n-1) = n : roundedSq (n+1)
| rem n 2 == 1 = n : floor ( ((2*10^((d-1) `div` 2)) + ceiling (n `div` (2*10^((d-1) `div` 2)) )) `div` 2 )
| otherwise = n : floor ( ((7*10^...
Hi
I have made on file called time.hs which contains a single function for measuring the time another function takes to complete.
Is there a way to import this time.hs file into the other haskell scripts I have made similar to import?
I sort of want:
module Main where
import C:\Haskell\time.hs
main = do
putStrLn "Starting..."
...
Solving a problem from Google Code Jam (2009.1A.A: "Multi-base happiness") I came up with an awkward (code-wise) solution, and I'm interested in how it could be improved.
The problem description, shortly, is: Find the smallest number bigger than 1 for which iteratively calculating the sum of squares of digits reaches 1, for all bases fr...
A classic programming exercise is to write a Lisp/Scheme interpreter in Lisp/Scheme. The power of the full language can be leveraged to produce an interpreter for a subset of the language.
Is there a similar exercise for Haskell? I'd like to implement a subset of Haskell using Haskell as the engine. Of course it can be done, but are the...
I have a type class Atomic, which defines functions for converting certain types to/from a wrapper value (Atom). I'd like to define a QuickCheck property which states: "for all instances of Atomic, any value may be stored and retrieved safely". The property looks like this:
class Atomic a where
toAtom :: a -> Atom
fromAtom :: At...
As my first haskell program I'm trying to do this - it's the hard way to get 1 to 10. I'm constructing an infinite list of integers, and sorting them, and taking the first 10. My intention was to convince myself that I could work with infinite lists without causing evaluation of them beyond what was strictly (ahem) required for the deman...
I am just learning scheme, but I would love to be able to repeat myself less.
Is there a way I can assign a name to a subexpression in the local scope?
As per the comment:
Haskell where clause
x = s * t
where s = 10
t = 20
x should be 200 in this case.
...
Hi, I wish to compress my application's network traffic.
According to the (latest?) "Haskell Popularity Rankings", zlib seems to be a pretty popular solution. zlib's interface uses ByteStrings:
compress :: ByteString -> ByteString
decompress :: ByteString -> ByteString
I am using regular Strings, which are also the data types used b...