>I am trying to understand the mechanism behind --
> why does the first example compile and what constraints does
> enumerateMethodNames add on a (which it does not inspect)?
enumerateMethodNames does not add on any constraints. If you
don't actually use "methods" GHC does not care what it's type
> methods :: (Eq a) => [(String, a)]
> methods =
> [ ("method1", undefined )
> , ("method2", undefined)
> ]
>
> enumerateMethodNames :: [String]
> enumerateMethodNames = map fst methods
The above does not compile because the source does not have
enough information for GHC to determine what a
> Then how does the 'Executable' section of your .cabal look like? That's what
> I can't get working.
Suitably elided.
Executable test
hs-source-dirs: src, tests
other-modules:Text.Yaml.Yay, Text.Yaml.Yay.Syck
main-is: Main.hs
build-depends:base, HsSyck,
> Okay, but have you ever felt the need to make in the same project a library
> and an executable which depends on this library (even just like me, for
> testing purpose)? How would you do it?
Specifying the modules under test in other-modules section for the executable
does the trick for me. I ca
> What's going on here? I'm not even calling function POP.
> *Data.Stack> let s2 = pop s1
> *Data.Stack> top s2
> *** Exception: Stack.hs:8:0-28: Non-exhaustive patterns in function pop
Haskell being a non strict language, does not evaluate pop s1 when you define
let s2 = pop s1.
but when you try
> So, is there a way to get an application
> directory path under Windows? I remember that there is a way to do this
> using WinAPI, but how to do this Haskell?
The System.Directory module has some methods to get specific
directory names in an OS agnostic manner.
The closest method that matches w
> Do you have any recommendations for a free/open source solution that would
>let me emulate a Windows
>environment for testing purposes?
Sun's Virtual Box? - http://www.virtualbox.org/
You would still need a Windows license though.
Cheers,
Rahul
___
>>*Main> dropFirst [3 4 5 6]
List members are separated by commas.
Space in Haskell denotes function application. Hence the error message:
Hence t
> No instance for (Num (t -> t1 -> t2 -> Int))
> arising from the literal `3' at :1:11-17
> Possible fix:
> add an instance declara
> OK, I think what you're saying is to work with (random) integers and use
> fromEnum and toEnum to get corresponding DayOfWeek. But I get this when I
> try to use toEnum:
>
> *Main> toEnum 2
ghci does not know what type of enum you want to create from the number 2.
Try: toEnum 2 :: DayOfWeek
Tha
On Wed, Apr 15, 2009 at 3:13 PM, michael rice wrote:
> Using Show it is possible to establish a relationship between an enum type
> and a String type to display it.
> Can one as easily establish a reverse relationship, i.e., convert a String
> type like "Red" back to its corresponding Color type?
Selenium (http://selenium.openqa.org/) might do what you want.
The bindings were announced on this list a little while ago
(http://tinyurl.com/se-bindings)
On Tue, Jul 15, 2008 at 3:12 PM, Jefferson Heard
<[EMAIL PROTECTED]> wrote:
> Is there a library out there that will allow me to remote-contro
On 8/9/07, Chad Scherrer <[EMAIL PROTECTED]> wrote:
> Is there process for submitting functions for consideration for
> inclusion into future versions of the standard libraries? For example,
> I'd like to see this in Data.List:
I imagine including it in std lib takes a while. Would it be a good
id
Using The Darcs version of HList (http://darcs.haskell.org/HList/), I
can do simple things with (H)lists just fine, so
--angus = Key 42
-- .*. Name "Angus"
-- .*. Cow
-- .*. Price 75.5
-- .*. HNil
--main = putStrLn (show angus)
works, On the other hand examples from the HList pa
I am having problems coming up with nice combinators for a simple
DSEL. The abstract syntax is simply given by the types:
data SearchCondition = SearchCondition BoolTerm | OpOr SearchCondition BoolTerm
data BoolTerm = BoolTerm BoolFactor | OpAnd BoolTerm BoolFactor
data BoolFactor = Constant Bo
>> Constructors and names of data types live in separate namespaces.
The above fact was the cause of all my confusion. It just slipped out
of my mind.
Cheers,
Rahul
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/li
Most examples for defining algebraic types include data constructors like so:
data Tree a = Tip | Node a (Tree a) (Tree a)
I by mistake defined a type which did not specify a data constructor :
data SearchCondition = Term Bool | SearchCondition :||: (Term Bool)
data Term a = Constant a
sc :: Se
I am having problems installing Takusen-0.6 (ghc 6.6.1 on FreeBSD)
The configure and build works fine. running ./setup install fails with:
Installing: /usr/local/lib/Takusen-0.6/ghc-6.6.1 & /usr/local/bin Takusen-0.6...
setup: Error: Could not find module: Database.Oracle.Enumerator with
any suff
17 matches
Mail list logo