Giter Site home page Giter Site logo

Comments (7)

tibbe avatar tibbe commented on June 11, 2024

What is containers.hs?

from containers.

treeowl avatar treeowl commented on June 11, 2024

I mean containers.h. Sorry. It's now #included in Data.Sequence.

from containers.

foxik avatar foxik commented on June 11, 2024

The containers.h is now included by all Haskell sources. It defines typeable instances, strictness macros and MIN_VERSION_base if it is undefined.

To compile Sequence.hs from Data directory, just add -I../include. To compile Data/Sequence.hs from the root of the repo, just add -Iinclude.

from containers.

tibbe avatar tibbe commented on June 11, 2024

This is not really much easier than including -optP-include -optPdist/build/autogen/cabal_macros.h.

from containers.

foxik avatar foxik commented on June 11, 2024

Agreed. The containers.h is not there because of cabal-less build. The containers.h contains

  • the INSTANCE_TYPEABLEx, which were in Typeable.h header -- that header collided with the Typeable.h header from base in some cases when correct include path was not used, which was the case in tests and in cabal-less builds. This is why I created a header with more unique name.
  • the STRICT_x_OF_y macros, which were defined in every file separately
  • definition of WORD_SIZE_IN_BITS for GHC
  • and lastly, it defines MIN_VERSION_base if it does not exist as a convenience for me, because it is the right place where to put it. But even if it wasn't here, we would still have containers.h.

from containers.

treeowl avatar treeowl commented on June 11, 2024

It looks like this file is a good idea, but would it be possible to use an explicit path for the #include?

#include "../include/containers.h"

Or would this cause some sort of trouble somewhere?

from containers.

foxik avatar foxik commented on June 11, 2024

Having common header file is quite common practice (running find on my packages returns bytestring, directory, primitive, process, unix, vector), as is using include-dirs cabal directive (all the mentioned packages use it). Personally I see no reason why not using it.

What you propose would probably work too, but I am quite satistifed with current (commonly used) solution.

from containers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.