Commit 022eb3a5 authored by Simon Marlow's avatar Simon Marlow

make some of these compile with GHC 6.6

parent 379fdc74
-- -*- haskell -*-
-- Time-stamp: <Wed Mar 21 2001 17:35:09 Stardate: [-30]6363.66 hwloidl>
-- Time-stamp: <2005-11-09 15:46:13 simonmar>
--
-- Doing a factorial-like computation, actually just sum, using a std
-- parallel divide-and-conquer stucture.
......@@ -8,8 +8,8 @@
module Main(main) where
import System(getArgs)
import Parallel
import System.Environment (getArgs)
import Control.Parallel
main = do args <- getArgs
let
......
-- -*- haskell -*-
-- Time-stamp: <Fri Mar 30 2001 14:32:21 Stardate: [-30]6407.82 hwloidl>
-- Time-stamp: <2005-11-09 15:57:20 simonmar>
--
-- Ever popular nfib, now in parallel.
-- Haskell98 version.
......@@ -7,9 +7,8 @@
module Main(main) where
import System(getArgs)
import {-fool mkdependHS; ToDo: rm-}
Parallel
import System.Environment (getArgs)
import Control.Parallel
main = do args <- getArgs
let
......
-- -*- haskell -*-
-- Time-stamp: <Fri Mar 30 2001 16:14:33 Stardate: [-30]6408.17 hwloidl>
-- Time-stamp: <2005-11-09 16:03:42 simonmar>
--
-- ADT of a binary tree (values only in leaves).
-- Parallel functions use par and seq directly.
......@@ -11,13 +11,13 @@ module Tree(Tree,
depth, create_forest,
force_tree, par_tree_map) where
import Parallel
import Control.Parallel
infixl 2 ^:
data (Integral a) => Tree a = Leaf a
| Node (Tree a) (Tree a)
deriving (Eq, Read, Show)
data Tree a = Leaf a
| Node (Tree a) (Tree a)
deriving (Eq, Read, Show)
tree_map :: (Integral a, Integral b) => (a -> b) -> Tree a -> Tree b
tree_map f (Leaf x) = Leaf (f x)
......
-- -*- haskell -*-
-- Time-stamp: <Mon Apr 02 2001 14:32:45 Stardate: [-30]6422.82 hwloidl>
-- Time-stamp: <2005-11-09 16:02:47 simonmar>
--
-- partree
-- parallel map over a tree
......@@ -7,8 +7,8 @@
module Main where
import System(getArgs)
import Parallel
import System.Environment(getArgs)
import Control.Parallel
import Tree
main = do args <- getArgs
......
module Rsa (encrypt, decrypt, makeKeys)
where
import {-fool mkdependHS; ToDo: rm-}
Parallel
import Control.Parallel
encrypt, decrypt :: Integer -> Integer -> String -> String
encrypt n e = unlines . parmap (show . power e n . code) . collect (size n)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment