14. HC14 ‐ Haskell Chapter 14 Practical Tasks: Cabal_and_language_extensions - wimsio/universities GitHub Wiki
-
-- HC14T1: Create a Haskell project using
cabal init
. Add a main executable that outputs "Hello, Cabal!". -
-- HC14T2: Modify the
.cabal
file to include a dependency on therandom
package and print a random number between 1 and 100. -
-- HC14T3: Enable the
NumericUnderscores
extension. Create variables with large numbers and print them. -
-- HC14T4: Enable the
TypeApplications
extension and create a function that reads a String and converts it to an Int usingread
. -
-- HC14T5: Write a Haskell program that uses a custom data type
Result a
and demonstrate pattern matching using the@
symbol. -
-- HC14T6: Create a cabal project structure with
src
andapp
directories. Place the main module in theapp
folder and additional modules insrc
. -
-- HC14T7: Modify the
.cabal
file to support a library component alongside the main executable. -
-- HC14T8: Implement a function
counts
that returns a list of tuples showing character frequency in a string. -
-- HC14T9: Use language extension
PartialTypeSignatures
to allow wildcard types in a function signature. -
-- HC14T10: Write a cabal test suite for a module that verifies correct behavior of the
counts
function. -
here
Finished. Congratulations! Get your progress token