diff options
| -rw-r--r-- | AufgabeFFP6.hs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/AufgabeFFP6.hs b/AufgabeFFP6.hs index 49d4e41..2e0a021 100644 --- a/AufgabeFFP6.hs +++ b/AufgabeFFP6.hs | |||
| @@ -1,8 +1,19 @@ | |||
| 1 | {-# LANGUAGE FlexibleInstances #-} | ||
| 2 | |||
| 1 | module AufgabeFFP6 | 3 | module AufgabeFFP6 |
| 2 | where | 4 | where |
| 3 | 5 | ||
| 4 | import Data.Array | 6 | import Data.Array |
| 5 | 7 | ||
| 8 | (+) :: Int -> Int -> Int | ||
| 9 | (+) = (Prelude.+) | ||
| 10 | |||
| 11 | (-) :: Int -> Int -> Int | ||
| 12 | (-) = (Prelude.-) | ||
| 13 | |||
| 14 | (*) :: Int -> Int -> Int | ||
| 15 | (*) = (Prelude.*) | ||
| 16 | |||
| 6 | (./.) :: Int -> Int -> Int | 17 | (./.) :: Int -> Int -> Int |
| 7 | (./.) = div | 18 | (./.) = div |
| 8 | 19 | ||
| @@ -18,5 +29,20 @@ eval a b = myfoldl' (elems b) (elems a) | |||
| 18 | 29 | ||
| 19 | -------------------------------------------------------------------------------- | 30 | -------------------------------------------------------------------------------- |
| 20 | 31 | ||
| 21 | --yield :: Array Int Int -> Int -> [Array Int (Int -> Int -> Int)] | 32 | -- yield :: Array Int Int -> Int -> [Array Int (Int -> Int -> Int)] |
| 33 | -- yield = yield_bt | ||
| 34 | -- yield = yield_gtf | ||
| 35 | |||
| 36 | -- yield_bt :: Array Int Int -> Int -> [Array Int (Int -> Int -> Int)] | ||
| 37 | -- yield_gtf :: Array Int Int -> Int -> [Array Int (Int -> Int -> Int)] | ||
| 38 | |||
| 39 | -------------------------------------------------------------------------------- | ||
| 40 | |||
| 22 | 41 | ||
| 42 | instance Show (Int -> Int -> Int) where | ||
| 43 | show op = case (3 `op` 3) of | ||
| 44 | 6 -> "plus" | ||
| 45 | 0 -> "minus" | ||
| 46 | 9 -> "times" | ||
| 47 | 1 -> "div" | ||
| 48 | _ -> "unknown" | ||
