- Mest känd för bokserien Utvandrarna
- Född och uppväxt i Småland
- Började skriva i ung ålder, vann pris när han var 13
- Han skrev även pjäser
- Har bott i amerika flera gånger, men emigrerade aldrig
- Debatterade mycket för sin åsikt som republikan
- Efter lång tid av depression dränkte han sig själv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Text.ParserCombinators.Parsec | |
import Control.Monad.Error | |
import System.Environment | |
main = do | |
expr <- getArgs >>= readExpr . head | |
putStrLn $ show $ eval expr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Text.ParserCombinators.Parsec | |
import Control.Monad.Error | |
import System.Environment | |
main = getArgs >>= putStrLn . readExpr . head | |
-- Parser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Text.ParserCombinators.Parsec | |
import Control.Monad.Error | |
import System.Environment | |
main = getArgs >>= putStrLn . readExpr . head | |
-- Parser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Warning: The package list for 'hackage.haskell.org' is 18 days old. | |
Run 'cabal update' to get the latest list of available packages. | |
Resolving dependencies... | |
Configuring lisp-0.1.0.0... | |
Building lisp-0.1.0.0... | |
Preprocessing executable 'lisp' for lisp-0.1.0.0... | |
[1 of 1] Compiling Main ( Main.hs, dist/build/lisp/lisp-tmp/Main.o ) | |
Main.hs:20:6: | |
Unexpected semi-colons in conditional: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Client where | |
import Network | |
import System.IO | |
runClient :: HostName -> PortNumber -> IO () | |
runClient ip port = do | |
h <- connectTo ip $ PortNumber port | |
putStrLn $ show h | |
listen h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import System.Environment | |
import System.IO | |
import Control.Monad (unless) | |
import Server | |
import Client | |
test :: HandlerFunc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import System.Environment | |
import Text.ParserCombinators.Parsec hiding (spaces) | |
import Control.Monad.Error | |
main :: IO () | |
main = do | |
input <- getLine | |
evaled <- return $ fmap show $ readExpr input >>= eval |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Main.hs:99:23: | |
No instance for (MonadError | |
(String -> LispVal -> LispError) ((->) [Char])) | |
arising from a use of `throwError' | |
Possible fix: | |
add an instance declaration for | |
(MonadError (String -> LispVal -> LispError) ((->) [Char])) | |
In the expression: throwError TypeMismatch "boolean" result | |
In a case alternative: | |
otherwise -> throwError TypeMismatch "boolean" result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isPal :: Eq a => [a] -> Bool | |
isPal [] = True | |
isPal xs = if (head xs) /= (last xs) then False | |
else if (head xs) == (last xs) then isPal $ drop 1 (init xs) | |
else True |