-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create "Getting started" tutorial. #6669
Conversation
5e6b7a8
to
a28df81
Compare
Thanks for writing this, it will be a great improvement for beginners.
Otoh not sure if the tutorial needs some changes to be executed. I've got an error following the instructions cause the cabal file generated has not the adequate
I am getting errors with the target for
|
As I commented, we should rather collect what we can simplify once 3.4 is released in a separate issue, but write the guide with |
Yeah, i guessed it would work with latest version. F.e. the caret operator is great but simply changing the example to be executable myfirstapp
main-is: Main.hs
build-depends:
base >=4.11 && <4.12,
haskell-say >=1.0.0.0 && < 1.1 You could remove the note about the caret operator and it would look simpler (more uniform) and it would be compatible with |
They won't. It's safer to assume that they won't read beyond Getting started if things just work. |
Mmm, yeah, cabal supports it even before, but
Fair enough. |
Hey @jneira, thanks for the feedback!
Added a link to a Windows walkthrough for getting Haskell set up.
tbh I haven't used Windows in years, is there anything specific I should change here?
Yeah, oops, I had forgotten that the change to switch |
|
||
``import HaskellSay (haskellSay)`` brings the ``haskellSay`` function from the | ||
module named ``HaskellSay`` into scope. The ``HaskellSay`` module is defined in | ||
the ``haskell-say`` packages that we added a dependency on above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to your previous comment. I think it would be actually good to find some library which has few transitive dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that in a (yet to be written) walkthrough on working with multiple packages in a project is where we could pull in more deps, wanted to keep this as simple as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not about multiple packages. It's about showing that cabal-install
does work for you. You don't have to worry (as a beginner) if a dependency has own dependencies, it just works :)
I'm irritated by recent article where is recommended to shave your dependencies to the minimum. No, use your own common sense.
|
||
.. code-block:: console | ||
|
||
$ ls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ls
would work in powershell, in dos we have to use dir
(the output will be different in any case but whatever)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like that if we ask windows users to use PowerShell than there're only small tweaks needed? casing for cmd
would make it all too messy and hard to follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, powershell is fine nowadays imo, it is even the default console in windows 10 (and available in previous versions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some words about it working on unix shells and PowerShell if you're a Windows user.
[ci skip]
97a03c2
to
f84416d
Compare
Create a Getting Started guide focused on newcomers to the Haskell ecosystem and Cabal. This page sits at the front of the Cabal user guide and walks through creating a new package, building and running it, and adding a dependency on a package from Hackage.
Rendered docs can be found at: https://m-renaud-haskell-cabal.readthedocs.io/en/mrenaud-docs-newcomer-tutorial/getting-started.html
Follow-up PRs:
cabal (v2-)build
docs (when they are written)^>=
(there's no place that really explains it currently):target
syntax (and write docs discussing target syntax to link to)Please include the following checklist in your PR:
[ci skip]
is used to avoid triggering the build bots.Please also shortly describe how you tested your change. Bonus points for added tests!