Created
July 7, 2018 05:59
-
-
Save jabgibson/232579d9f9604a0d77b1f3bbf80dc472 to your computer and use it in GitHub Desktop.
Playing Haskell
This file contains 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
-- firsthalf returns True if value is found in the first half of list ls | |
firsthalf value ls = elem val (reverse (drop (quot (length ls) 2) (reverse ls))) | |
-- subsek returns a subsection of list ls from start to end | |
subsek start end ls = drop start (reverse (drop (length ls - end) (reverse ls))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment