Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Métodos simples
--ghc 8.0.1 /opt/ghc/8.0.1/lib/ghc-8.0.0.20160127/ iguais :: (Eq a) => [a] -> Bool iguais [] = True iguais (x:[]) = True iguais (x:y:xs) | x == y = iguais (y:xs) | otherwise = False maior :: (Ord t, Num t) => [t] -> t maior [] = error "Lista não possui elementos." maior (x:xs) = mc xs x where mc [] m = m mc (x:xs) m | x > m = mc xs x | otherwise = mc xs m inserir :: (Ord a) => a -> [a] -> [a] inserir e [] = [e] inserir e (x:xs) | e > x = x : inserir e xs | otherwise = e : x : xs main = print $ inserir 4 [0, 1, 3, 6, 7, 8]
run
|
edit
|
history
|
help
0
suffix trie
pascal triangle
Sierpinski Triangle as lazy list
=)
project euler 9, haskell
(-‿‿-)
hard 1.1
Goodstein sequences
Knight Journey
ReadablePractice