Re: [Haskell] ANNOUNCE: GHC version 7.6.1
Hi, On 6 September 2012 18:49, Thomas DuBuisson wrote: > > I don't remember if this was part of the motivation in creating this > > feature, but it has a nice use case: asserting on a test suite that > > something should *not* type check. > > We're getting more meta than Haskell provides cleanly, but all > significant uses I can currently think of for something like that > would require universal quantification over types: One way could be: import Control.Spoon f = 1 + 'a' test = assertTrue (teaspoon f == Nothing) -- Ozgur Akgun ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: default instance for IsString
One can always use a Maybe to make an IsString literal total. Perhaps this is what library authors should do in those cases when a fromString implementation is obviously partial. i.e. instead of instance IsString XML where ... define: instance IsString (Maybe XML) where ... HTH, Ozgur On 24 April 2012 15:03, Yitzchak Gale wrote: > Daniel Peebles wrote: > > Why are potentially partial literals scarier than the fact that every > value > > in the language could lead to an exception when forced? > > That's a legitimate question, but it's strange to hear it from > you. > > People ask that same question about Haskell's static > type system. Why bother? Every value could lead to an > exception when forced. So we might as well check > everything at run time. > > Wouldn't it be ironic if the one thing that every language > other than Haskell is able to check at compile time, > namely the static syntax of string literals, could only be > checked at run time in Haskell? Especially when, with just > a little care, we could easily continue to check it at compile > time while still supporting string literals of type Text > and ByteString. > > I guess I'm just not understanding your question. > > Thanks, > Yitz > ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: How to work around GHC bug
Hi again, On 14 March 2012 14:17, Volker Wysk wrote: > That's not true. The result is: > > ./tmp $ ./arg ä > ä > This prints out ä on my machine. However, I see the point about length "ä" not being 1, so I am not claiming that there is no problem. Good luck, Ozgur ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: How to work around GHC bug
Hi, On 14 March 2012 13:51, Volker Wysk wrote: > import System > > main = do > > [a] <- getArgs > > putStrLn (show a) > a here is already of type String. If you don't call show on it, it'll do the expected thing. Try: main = do [a] <- getArgs putStrLn a HTH, Ozgur ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users