Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Haskell from Another Site
Haskell from Another Site
Haskell from Another Site
Ebook129 pages1 hour

Haskell from Another Site

Rating: 0 out of 5 stars

()

Read preview

About this ebook

Build your knowledge of Haskell types with this insightful resource.

The first book of its type on learning how types work in the Haskell programming language. It contains many simplified diagrams and descriptions of methods, datatypes, newtypes, and classes. The first two chapters help you configure the IDE, stack, and cabal so that you can practice writing and understanding type signatures while reading the rest of the book. The author mainly teaches how to deal with errors that occur.

It covers a wide variety of topics, including:
- IDE configuration (Visual Studio Code)
- Cabal and Stack
- Comparison of Cabal file contents to Package.yaml
- Reading and understanding errors when using Stack
- Links to additional resources
- Reading and understanding documentation
- Reading and understanding source code
- Type signatures prediction
- Lambdabot commands

This book is ideal for people who know anything about the language but are not yet able to explore new areas of the language on their own. If you haven't figured out how to deal with programming in this language, then all the more reason this book is for you.

LanguageEnglish
Release dateMay 13, 2021
ISBN9780463998472
Haskell from Another Site
Author

Jagoda Górska

I'm a graduate Computer Science and Econometrics at the College of Economics and Computer Science in Cracow, where I wrote my thesis on the usage of functional languages in business. Since 2015, I have been active as a programming languages enthusiast, writing patches and developing open source programs from time to time through a version control system. Since 2021, I'm is also developing as an electronics engineer.

Related to Haskell from Another Site

Related ebooks

Programming For You

View More

Related articles

Reviews for Haskell from Another Site

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Haskell from Another Site - Jagoda Górska

    Haskell from Another Side

    Copyright 2021 Jagoda Górska

    Published by Jagoda Górska at Smashwords

    Smashwords Edition License Notes

    This ebook is licensed for your personal enjoyment only. This ebook may not be re-sold or given away to other people. If you would like to share this book with another person, please purchase an additional copy for each recipient. If you’re reading this book and did not purchase it, or it was not purchased for your use only, then please return to your favorite ebook retailer and purchase your own copy. Thank you for respecting the hard work of this author.

    Table of Contents

    Preface

    1. Programming with IDE

    2. Stack and Cabal configuration

    Information inside stack.yaml

    Information inside package.yaml and .cabal

    Appearance of the Setup.hs file depending on the build type

    Fixing continuous inconsistency in dependency versions

    Frequently asked questions about stack and cabal

    3. Use of documentation on the example of a base package

    Reading datatype

    Reading newtype

    Reading class

    Reading functions

    4. Reading and understanding source code

    5. Type signature prediction

    6. Understanding error messages

    7. Lambdabot and Hackage

    Send Feedback

    About the Author

    Connect with me

    Preface

    This book sheds a slightly different light on programming in Haskell. It is not a typical book that sticks to preconceived rules. The purpose of the book is to help someone who is interested in learning the language but does not know how to deal with it. The book should be treated as a bridge to discover the world of this language on your own, which will eventually allow you to get closer to advanced topics after some time. If you are very experienced and know a lot, you may find the tips a bit unusual or confusing. Nevertheless, I encourage you to read it because maybe it will help you find your own way to develop in this language.

    Who is this book for?

    This book is for people who have a basic understanding of the Haskell language, but have lost the courage to learn further or have difficulty in understanding it. It is an ideal book for those who have not yet found a way to explore things unknown to them in this world and would like to be more independent. After all, it is not the what but the how that is more important.

    1. Programming with IDE

    Many people have no idea what to program in when it comes to IDEs. However, there are some solutions that are multiplatform, and you can read about them at wiki.haskell.org/IDEs. The first example that comes to my mind is the free Visual Studio Code, which offers many extensions for this programming language. I use it most often myself.

    If you want to see these extensions, you need to select the sixth icon, counting from top to bottom. If you look closely, you will see these icons on the left side. The icon we are interested in is highlighted in white in the picture (and marked in red by me). However, you should remember one thing before you start using these extensions. It is worth reading sections like requirements or configuration, without which the extension will not work properly or even at all. For example, for the haskell-linter extension it looks like this:

    From the content, it seems that the hlint package version 1.9.1 or above is required for the extension to work. The path, where the package was installed, should be visible in the IDE and the place where this path should be included is shown in the illustration. So let's install hlint with the stack or cabal. If you don't have them installed, download from the repository, if you have Linux or if not – from the official website. On this website everything is listed for each system. Install the package like this:

    stack update

    stack install hlint

    or:

    cabal update

    cabal install hlint

    If we want to open a terminal in this IDE, look above in the main menu, in the Terminal tab and select New Terminal. When the terminal appears, type the stack or cabal commands. We did not specify the program version because in that case, after stack update or cabal update we will install the latest available package version (unless we are installing inside a project that contains its own stack.yaml file. If you want to start by generating a project, see further).

    If we want to add configuration content as we are asked to, we obviously need to know where. When the extension is installed, a gear appears instead of the blue Install button if, of course, you have previously clicked on it with your mouse. You have to select this gear and choose Extension Settings:

    In the image below, we see the setting options for our extension. However, we want to put a line which we still remember about. This line must be placed in settings.json, and we

    Enjoying the preview?
    Page 1 of 1