Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can packages be unhidden when using only stack?

I'd like to try out the Writer monad in ghci. As advised here, I tried to use only stack to manage GHC and packages, and avoid a global installation.

From a fresh Ubuntu 15.04 install, after installing stack:

stack setup
mkdir lyah && cd lyah
stack new
stack install mtl
stack ghci
ghci> import Control.Monad.Writer
Could not find module ‘Control.Monad.Writer’
It is a member of the hidden package ‘mtl-2.1.3.1’.

I understand that pre-stack ghc-pkg was used to show/hide packages, but I'm not sure how to proceed here to 'unhide' the mtl package.

like image 745
jazmit Avatar asked Jul 23 '15 16:07

jazmit


People also ask

What happens if no package is specified in a file?

If no package is specified, the classes in the file goes into a special unnamed package (the same unnamed package for all files). All classes/interfaces in a file are part of the same package. Multiple files can specify the same package name.

How to implement a stack in a linked list?

A stack can be easily implemented through the linked list. In stack Implementation, a stack contains a top pointer. which is “head” of the stack where pushing and popping items happens at the head of the list. first node have null in link field and second node link have first node address in link field...

How do you keep employees from stacking things?

Make Stacking and Storage Visual. Using visual cues to remind employees where to put stacks and how high stacks should be piled are simple ways to prevent mishaps. Floor tape, for example, can be placed around the corners or edges of stacks to remind employees where a stack should be placed.

How do you keep a stack from collapsing?

When materials are stacked too high or in an unstable arrangement, removing an item from the stack or bumping the stack can cause the rest of the materials to fall down. If heavy objects are involved, this can pose a real threat to employees. Using an appropriate stacking method is one of the best ways to keep a stack from collapsing.


1 Answers

Just to complement @Jazmit answer. Be aware that your .cabal file will have two build-depends sections. One under library: and the other under executable my-project-exec. In this case, you'd need to put the module under the executable section.

Example:

my-project.cabal

library: 
  build-depends:
  ...

executable my-project-exe:
  build-depends:
    base >= 4.7 && < 5
    , mtl

For further info about library and executable check the docs: https://cabal.readthedocs.io/en/latest/developing-packages.html#editing-the-cabal-file

like image 112
Dan Avatar answered Sep 28 '22 12:09

Dan