« first day    last day (693 days later) » 

1:28 AM
posted on February 15, 2013 by Kelsey Abreu

so I'm wondering if there is a way to use map or list comprehension when the function has more than 2 arguments? Example f a b [c] = something is there a way so I can do map (f a b) c or [f a b x | x <- xs] Pretty much, I would like the function to retain those two variables a and b and apply it to all the elements in [z]

 
 
3 hours later…
4:01 AM
0
Q: Haskell Cartesian Product Recursively

user2074245I know how to use list comprehension to do this, but how can I implement a function that will recursively compute the cartesian product given two sets? Here's where I'm stuck (and I'm a noob) crossProd :: [Int] -> [Int] -> [(Int,Int)] crossProd xs ys | xs == [] || ys == [] = [] ...

 
 
7 hours later…
10:54 AM
-1
Q: Authorized connection to mongoDB in Haskell

johnny-johnI am using this driver http://hackage.haskell.org/package/mongoDB I can't find anything related in the docs or source.

 
Passing 10,000 Haskell tagged Questions !!!!
 
 
1 hour later…
12:28 PM
@Zoidberg Is it just me, or is feeding way too much? Maybe we should pick a different tag.
 
1:09 PM
0
Q: Remove elements during infinite sequence generation

tanasciusI found a great haskell solution (source) for generating a Hofstadter sequence: hofstadter = unfoldr (\(r:s:ss) -> Just (r, r+s:delete (r+s) ss)) [1..] Now, I am trying to write such a solution in F#, too. Unfortunately (I am not really familar to F#) I had no success so far. My problem is...

 
2:04 PM
0
Q: Printing Text.Pandoc.writers into ghci : No Show instance

zurglWhat am I trying to do ? Print under ghci the association list of formats and writers. See doc : writers :: [(String, Writer)] Association list of formats and writers. What has been tried zurgl>>>import Text.Pandoc as P zurgl>>>P.writers <interactive>:20:1: N...

 
2:40 PM
posted on February 15, 2013

Time for another upgrade of my GHC installation. OK, I know I already posted about this twice but yet again the process was different from the previous ones. My first attempts of installing GHC and the Haskell Platform a year ago relied on using packages from my distribution’s repository. This quickly turned out to be problematic so I decided for a direct installation of the Haskell Platform.

 
user142019
@FredOverflow jup xD
 
3:13 PM
0
Q: Haskell: Non-exhaustive patterns in function (simple functions)

BradStevensonI am confused as to why the 1st and 3rd versions of this functions give this error whereas the second definition works fine. -- head and tail third :: [a] -> a third [a] = head (tail (tail[a])) -- Pattern matching third2 :: [a] -> a third2 (_:_:x:_) = x -- List indexing third3 :: [a] -&g...

 
3:31 PM
0
Q: recursive function for handling Data.Text replace outputs a way longer text than expected

nils8950I have a handleReplace function in Haskell, which is of type handleReplace :: Character -> T.Text -> T.Text T is just the Data.Text module as a qualified import So this function takes a Character type, which is defined like this: data Character = Character (String, String, String, Str...

 
 
4 hours later…
7:47 PM
0
Q: Exception : Pattern Matching failure Haskell

dustHi I am trying to implement Standard words function of Haskell. I am using State Monad to solve the problem. My Code is : type WorS = ([String],String,String) words'::State WorS [String] words' = do (lwords,words,x:xs)<-get case x:xs of (' ':xs) -> (put(wo...

 
 
2 hours later…
9:32 PM
0
Q: lazy list reconstructed based on concreteness of its type?

James CunninghamI wrote a simple (and unserious) prime number generator in Haskell, with mutually-recursive definitions for generating the primes and for determining the primeness of a number: primes :: (Integral a) => [a] primes = 2 : filter isPrime [3, 5..] isPrime :: (Integral a) => a -> Bool isPri...

 
10:05 PM
1
Q: Printing an AST with variable names

PaulI am trying to implement an EDSL in Haskell. I would like to pretty print the AST with the variable names that are bound (if I can't get the real names then some generated names would do). This is how far I have got with a simple example: import Control.Monad.State data Free f a = Roll (f (Fre...

 
10:38 PM
posted on February 15, 2013 by mightybyte

The end of last month saw the 0.11 release of the heist and snap packages. It was not accompanied by our traditional announcement and release notes blog post, and some people have been asking about it. Here is a brief description of what is going on and how the 0.11 release affects you. tl;dr The core functionality of compiled heist is stable, but the API is still maturing. 0.11 is a significa

-1
Q: Reading contents from a script file and convert to html format

Vega512The purpose of this task is to implement a program that is to be invoked in batch mode to process a text document. Write a text processor that generates an HTML file out of its input file. The input file, called the script file, contains the text to format with formatting directives embedded in the...

 

« first day    last day (693 days later) »