hugs Questions
2
For my studies I have to write the following function which gets the shortest route between two countries. I already have already written a function isRoute which checks if there is a connection be...
6
Solved
I just started with Haskell and tried to do write some tests first. Basically, I want to define some function and than call this function to check the behavior.
add :: Integer -> Integer ->...
5
Solved
There are differences between Hugs, Yhc and GHCi? If there are differences, What are they?
Kamp asked 8/11, 2009 at 22:27
2
Solved
I'm using Hugs interpreter and I want to execute the following code (by Haskell 2010 language report):
let x = 1
z = x+y
in z+1
Is it possible only creating a .hs file and loading? Can I do it b...
2
Solved
I was playing around with hugs today and got stuck at a very simple question:
λ 1 1
:: (Num a, Num (a -> t)) => t
What would that type be? I am having trouble to read this.
And if it has ...
3
Solved
I'm reading Programming in Haskell book and testing provided examples in GHCi interpreter. It turns out, that there is a difference in Int type behavior in GHCi and Hugs interpreter. According to C...
1
Solved
I define five functions that seem to me like they should be equivalent (and, therefore, have the same type). But the inferred types are different. I put the following five lines in type-inference.h...
Britanybritches asked 30/11, 2013 at 15:51
2
Solved
Given a list of points in a two dimensional space, you want to perform a function in
Haskell to find the distance between the two closest points.
example:
Input: project [(1,5), (3,4), (2,8), (-1,2...
Volcanic asked 17/11, 2012 at 5:56
2
Solved
Patterns like this:
front :: [a] -> a
front (x:_) = x
front _ = error "Empty list"
seem to be common in Haskell, but I distinctively remember learning the following when I started learning Ha...
Electricity asked 13/9, 2012 at 19:46
2
Solved
I'd like to write a Haskell program that uses GADTs interactively on a platform not supported by GHCi (namely, GNU/Linux on mipsel). The problem is, the construct that can be used to define a GADT ...
Diathermic asked 22/6, 2012 at 14:19
1
Solved
Hugs seems to have a problem with several non-enbraced !! in a partial application.
While this works fine in GHCi:
([[0]]!!0!!)0
Hugs reports a syntax error for the ).
Is this a bug in Hugs?
...
2
I'm working on parsing a CSV file into a CSV type which is a list of Record which is a list of Field, which are just Strings. After inserting a new row and then trying to access the csv I get the c...
Inappropriate asked 4/1, 2012 at 14:23
2
Solved
I'm writing a C++ application that needs to interpret and evaluate haskell code. This code isn't known at compile time but given by the user.
Is there a way to use a haskell compiler/interpreter (l...
2
Solved
Came across this while playing with Haskell and I'm stumped:
Hugs> :type (\x -> x^2)
\x -> x ^ 2 :: (Integral a, Num b) => b -> b
What is a doing in there? How am I supposed to re...
2
Solved
Is there a Haskell interpreter that accepts type definitions or preferably all kinds of statements?
I've already tried ghci and hugs and none of these does that. Is there some particular reason th...
Biota asked 11/10, 2011 at 9:10
2
Solved
f :: Integer -> Integer -> [Integer]
f i n = n : f (i+2) (n+i)
can someone explain to me what it does. i know it returns [0,1,4,9,16..] but i dont understand how and what n : f means
1
© 2022 - 2024 — McMap. All rights reserved.