35 Topics
Hi, I'm really, *really* new to Haskell. I'm practicing with simple online questions and there's a hcf question which I found the answer to online(http://snipplr.com/view.php?codeview&id=11973) but I still don't understand the coding. I'm not sure if this kind of question is accepted in Daniweb but yeah. Could someone please explain …
Hey. I've been working on a home brew game since late last year, writing an engine in Haskell and GLSL that includes 3D graphics, basic physics and programmable game logic. The version in the second video shows the first appearance of lighting and importation of OBJ files (the cube was …
I am trying to install haskell on xubuntu precise for my haskell class and I cant get it to work. I keep getting 'prelude' module is not available and I have spent hours back and forth installing and uninstalling ghc. Can someone please tell me how to get this thing …
I am trying to learn a bit of Haskell but I am having some problems with understanding how to make programs with pow*. For example I have to create the following program: What the program does is 1+2(pow2)+3(pow2)+n(pow2) and then to make sure that n is positive number. If someone …
Hi, My teacher asked us to do some exercises using haskell, one of these exercises asks us to implement a simple calculator, like this: The first input is an Integer N, which tells how many operands will be used, the following N inputs are the operands and the operators themselves, …
Hello, I have an issue using Haskell's Command-Line args functionality. I'm writing a Typechecker for my parser and I need to be able to tell my program via command-line arguments that I can have at most x errors reported where x is: ./typechecker --number-of-errors=x test.cl This is the run-statement I …
Hi all, i need a little help for haskell. i try to make a program which makes the romans numbers in a good form, so for example if u put in [I,I,I,I] it change it to [I,V] but something always wrong with the patterns :( what did i wrong? data …
Hi Basically I've got the following code. - What it does is it takes two input the itemName and the sectionName - checks if the input is equal to any item in the list (test database) and increment it - prints the modified list It does what it needs to …
im making a program which uses binarys so convert decimal numbers, characters, strings to binary numbers and work with them. but i got stucked because i want to divide Bin with Bin. something like this: 11010110110000 / 10011 = 01001110110000 so the new number will the 1001110110000 / 10011... until …
Hello, i want a program which convert Dec,Char,String to Bin. but i got stucked in Char because i want to do 8 bit long list and if its not 8 long i put zeros in the front but something always wrong. import Data.Char (ord) toBinary :: Int -> [Int] toBinary …
Hi. I'm working on some Haskell code that takes some string input and processes it to return a list of integers, the reason for which should become clear when the app. eventually get finished. The list processing functions do what I want when I call "parse_data (contents)" in GHCi, but …
Hi. I've been trying to get this simple function in Haskell to let me call it for many hours and come to a problem I can't find an answer for. The function is of type Float -> Float -> [Int] so I need to pass it two Float values. I've …
Hey, I'm a beginner at compiling (or interpreting) Haskell and some of the basic things are hard to do especially when theres not a lot of info out there for me to use. My question is, how do I run a test file after I have compiled? I compiler with: …
Hello everyone, I've been doing a project for class in Haskell. Basically I've completed my program except some parts in my lexer function. I have functions marked undefined where I haven't completed it. [CODE]lexer :: String -> Pos -> [Token] lexer str pos = case str of x:xs | isSpace …
Greetings to all Forum users, Yesterday i tried to install a Haskell-module via cabal, in order to get aquainted with the installation of modules in Haskell. I had to install cabal first. My System: Windows 7 Haskell-Compiler Version: GHC 7.0.2 (Link [url]http://www.haskell.org/ghc/download[/url]) Cabal: [url]http://haskell.org/cabal/download.html[/url] I will describe the process step …
I normally program in Java and Haskell to me seems completely alien and weird. All I want to do is read the contents of a file into a big string then be able to do stuff with that string like split it on newline and store it in a list …
Anyone have much experience in Haskell? I'm a comp sci student and have a project to essentially write a parser and an interpreter in Haskell. Would be grateful if anyone could suggest some resources (books or on web), or if I send in my code if anyone could make suggestions …
hi i m new to Haskell, i need help in the deposit money in this simple atm bank system the problem shown during enter amount on deposit" Program error: Prelude.read: no parse" below is the code.Please help.Thank you [CODE]import System.IO start :: IO () start = do putStrLn "------------------" putStrLn …
I am fairly new to Haskell and have been experimenting with data and class declarations. I have been trying to do this: [CODE=Haskell]data Fire = Burn | Ember data Water = Bubble | WaterGun class Elements a instance Elements Fire instance Elements Water data Elemental = Elemental { name :: …
I've never used Haskell before and I'm struggling with the IO side of things. The code I'm writing, yes, is for a Uni assignment, and for that reason I'm not putting my whole code on here in case I get complained at for one of the many plagiarism clauses... so …
I was planning on taking a program regarding haskell, but I don't know if its the good thing.. I mean... some said its like out of style ... I am still searching and trying to know if I need it ... or if I need to learn more about functional …
Hello everyone and welcome to the next episode of Mushy-pea's blog. This entry is about my favourite language (except English of course) Perl. If you're a regular Perl user you might already know this; the developers of Perl 6 are using a prototype version of the Perl 6 interpreter written …
Well, I asked Dani and she said I could create a Haskell catagory in code snippits just by submitting a Haskell program :p . What self respecting code repository would be without one? So here goes, this program calculates the nth triangular number, given n by the user. Steven.
I want to write a function that displays the whole contents of a list. But im not sure how to do so. I have displayed my datatype of which i want to print...and at the bottom is the function that I want to print the list with. Thanks in advance. …
I havent done much IO at all in haskell, only within the function itself. However I want to get the input from the interface for the function and havent done this before. // Say I have this as my data type and list of films data Film = Film String …
What I need to do is build a type of database. Firstly have a few questions, whether what I have done it right...and how to do something else. This is my algebraic type for the database (correct me if its wrong) data Film = Film String String Int String with …
Hello, I want to create a tree structure in haskell so that later I can do a depth first search on it to find something. Here is an example I have thought of to try and understand the concept - [CODE]data Tree a = Nil | Node a (Tree a) …
I know how to throw an error in Haskell however I don't know how to do it for the read function. When I do something like this: -- find the number on the second line of file/second list of strings getNo :: String->Int getNo inputBigString = read((listOfLines inputBigString) !! 1) …
I am just starting off in a haskell course and I am trying to write a program that takes a list representing an int such as [1,4,3] would mean 143, and convert it to binary and return it as a list in the same fashion. I have written the following …
I downloaded the most recent vesion of winHugs and I installed it. I'm trying to follow a [url=http://www.ssw.uni-linz.ac.at/Teaching/Lectures/SpezialLVA/Stanczyk/]tutorial[/url] about the commands (hugs2List pg 3). I try to use the Prelude function isDigit, but this gives an error. -- File second.hs getDigits :: [Char] -> [Char] getDigits s = [C|c <-s, …
Hi folks. I decided to learn a functional language in order to increase my programming knowledge and was advised to learn Haskell. I didn't find any useful books, so one of my friends (former software engineering student) gave me his class notes, including tons of exercises. However, he claimed he …
Hello, Im studing functional programming using haskell and i have problems with some excercises about types. They give me an expresion and i have to wirte down the type for that expresion. I was wondering if there is any method or something that allow me to make that without loosing …
Hello everyone. I have been using the Haskell compiler GHC 6.6 a bit recently to test some simple programs (for learning purposes). In it's default mode it produces three output files for a given source file: a .exe, a .o and a .hi. The .exe is quite big and I …
Hello everyone. If you're a regular Perl user you might already know this; the developers of Perl 6 are using a prototype version of the Perl 6 interpreter written in Haskell to do various "proof of principle" testing. It's called Pugs (maybe a pun on the Haskell interpreter Hugs). However, …
Hello everyone, I'm new here and have browsed through some discussions and found it useful. I was wondering if anyone could help me with a functional programming problem in Haskell. Im trying to define a function seg, which is supposed to take a finite list xs as its argument and …
The End.