[Haskell-cafe] Conflict with Network.CGI and System.Random

2011-08-23 Thread william murphy
Hello all, I'm trying to write a program to be converted into a cgi file using Network.CGI and Text.Xhtml, and I want to have random numbers in it. Sounds simple, but I need to call the global random generator (I think) and I can't do that in the CGI block, i.e. cgiTMain = do gen <- g

[Haskell-cafe] Network.CGI and SQL Queries

2011-07-20 Thread william murphy
Hello there, There's an odd error every time I try to run this code: import Network.CGI import Text.XHtml import qualified Text.Html as H import Database.HDBC import Database.HDBC.Sqlite3 import System.Random ... sqlReaderIO = do handle <- connectSqlite3 "table2.db" scoresSql <- quickQu

[Haskell-cafe] Network.Html simpleTable fonts

2011-07-17 Thread william murphy
How does one change the font and size of text in a cells in a simpleTable? As in, to change the height, one could state: x = simpleTable [] [height "5"] exampleTable Thanks, Will ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell

[Haskell-cafe] Failure to install Network.CGI

2011-07-16 Thread william murphy
Hi all, I tried to install the Network.CGI module by inputting: cabal install CGI into the terminal but got this error: Resolving dependencies... Configuring cgi-3001.1.8.2... Preprocessing library cgi-3001.1.8.2... Building cgi-3001.1.8.2... : cannot satisfy -package-id network-2.3.0.2-24fdc6b

[Haskell-cafe] Incorrectly inferring type [t]

2010-12-29 Thread william murphy
Hi All, I've spent a lot of time trying to write a version of concat, which concatenates lists of any "depth": So: concat'' [[[1,2],[3,4]],[[5]]] would return: [1,2,3,4,5] The code is: concat'' :: [a] -> [b] concat'' ((y:ys):xs) = (concat'' (y:ys)) ++ (concat'' xs) concat'' []

[Haskell-cafe] multi type addition

2010-12-28 Thread william murphy
We were trying to make an addition function that, unlike the library one, could add numbers of different types from the typeclass 'Num.' We originally ran into a problem when trying to add (5 :: Integer) + 4.8, and were trying to define a new function that would be able to get that: (+') :: (Num a