Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
3
Task/Abstract-type/Haskell/abstract-type-1.hs
Normal file
3
Task/Abstract-type/Haskell/abstract-type-1.hs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class Eq a where
|
||||
(==) :: a -> a -> Bool
|
||||
(/=) :: a -> a -> Bool
|
||||
5
Task/Abstract-type/Haskell/abstract-type-2.hs
Normal file
5
Task/Abstract-type/Haskell/abstract-type-2.hs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
class Eq a where
|
||||
(==) :: a -> a -> Bool
|
||||
(/=) :: a -> a -> Bool
|
||||
x /= y = not (x == y)
|
||||
x == y = not (x /= y)
|
||||
2
Task/Abstract-type/Haskell/abstract-type-3.hs
Normal file
2
Task/Abstract-type/Haskell/abstract-type-3.hs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
func :: (Eq a) => a -> Bool
|
||||
func x = x == x
|
||||
1
Task/Abstract-type/Haskell/abstract-type-4.hs
Normal file
1
Task/Abstract-type/Haskell/abstract-type-4.hs
Normal file
|
|
@ -0,0 +1 @@
|
|||
data Foo = Foo {x :: Integer, str :: String}
|
||||
3
Task/Abstract-type/Haskell/abstract-type-5.hs
Normal file
3
Task/Abstract-type/Haskell/abstract-type-5.hs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
instance Eq Foo where
|
||||
(Foo x1 str1) == (Foo x2 str2) =
|
||||
(x1 == x2) && (str1 == str2)
|
||||
3
Task/Abstract-type/Haskell/abstract-type-6.hs
Normal file
3
Task/Abstract-type/Haskell/abstract-type-6.hs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class abstraction()
|
||||
abstract method compare(l,r) # generates runerr(700, "method compare()")
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue