Sign up
Log in
Home
Language tracks
PureScript track
Exercises
Exercises on the PureScript track
Join the PureScript Track
28 exercises to help you master PureScript
easy
Hello World
The classical introductory exercise. Just say "Hello, World!"
maybe
strings
easy
Leap
Given a year, report if it is a leap year.
modulo
booleans
easy
Pangram
Determine if a sentence is a pangram.
chars
strings
easy
Bob
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
strings
easy
Accumulate
Implement the `accumulate` operation, which, given a collection and an operation to perform on each element of the collection, returns a new collection containing the result of applying that operation to each element of the input collection.
pattern matching
recursion
type variables
easy
Collatz Conjecture
Calculate the number of steps to reach 1 using the Collatz conjecture
arithmetics
maybe
math
easy
RNA Transcription
Given a DNA strand, return its RNA Complement Transcription.
maybe
strings
easy
Sum Of Multiples
Given a number, find the sum of all the multiples of particular numbers up to but not including that number.
arithmetics
arrays
modulo
math
easy
Raindrops
Convert a number to a string, the content of which depends on the number's factors.
modulo
easy
Hamming
Calculate the Hamming difference between two DNA strands.
iterating over two lists at once
easy
Scrabble Score
Given a word, compute the Scrabble score for that word.
chars
strings
easy
Acronym
Convert a long phrase to its acronym
chars
strings
easy
Triangle
Determine if a triangle is equilateral, isosceles, or scalene.
algebraic data types
type classes
medium
Word Count
Given a phrase, count the occurrences of each word in that phrase.
strings
maps
regex
medium
Meetup
Calculate the date of meetups.
dates
easy
Atbash Cipher
Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
strings
medium
Bracket Push
dates
easy
Allergies
Given a person's allergy score, determine whether or not they're allergic to a given item, and their full list of allergies.
bitwise operations
maps
medium
All Your Base
Convert a number, represented as a sequence of digits in one base, to any other base.
base conversion
math
medium
Binary Search
Implement a binary search algorithm.
binary search
algorithms
easy
Difference Of Squares
Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.
arithmetics
math
easy
Diamond
Given a letter, print a diamond starting with 'A' with the supplied letter at the widest point.
strings
medium
Crypto Square
Implement the classic method for composing secret messages called a square code.
matrices
strings
easy
Isogram
Determine if a word or phrase is an isogram.
maps
strings
easy
ETL
We are going to do the `Transform` step of an Extract-Transform-Load.
maps
medium
Largest Series Product
Given a string of digits, calculate the largest product for a contiguous substring of digits of length n.
strings
math
medium
Pascal's Triangle
Compute Pascal's triangle up to a given number of rows.
arrays
math
easy
Phone Number
Clean up user-entered phone numbers so that they can be sent SMS messages.
conditionals
pattern matching
strings