Comments (9)
I started some work here https://github.com/wasp-lang/haskell-handbook/blob/master/module-tree-api.md .
from haskell-handbook.
Regarding vertical vs horizontal -> I also prefer vertical approach, as Gabriella suggests. I figured that out for the first time while working on AngularJS projects some time ago and have stuck with it since then. I usually call that "feature-based" organization vs "type-based" organization, based on this article: https://johnpapa.net/angular-growth-structure/ .
from haskell-handbook.
I covered this briefly in learn-haskell-blog-generator:
from haskell-handbook.
@soupi thanks, these are nice explanations, they will come in handy! Besides giving extra control to the library consumer, I also found Internal modules to be the only way to test inner workings of a module.
from haskell-handbook.
Haskell school will have a section on module: haskellfoundation/HaskellSchool#28
from haskell-handbook.
Haskell school will have a section on module: haskellfoundation/HaskellSchool#28
Thanks! They seem to be focusing on basic workings of modules -> I instead hope to focus on organizing them from the higher level and using Internal as a mechanism.
from haskell-handbook.
In that case, I've covered internal modules in the book, and Gabriella suggests one way to organize modules (which is a bit different than what I've seen in many places, but definitely good general advice).
from haskell-handbook.
Aha I haven't noticed you covered that in your book, that is great! Some thoughts:
- If I am developing module X, I usually don't put everything into X.Internal and then re-export only "public" stuff in the X. Instead, I usually start writing module X, and then when I figure out something is internal/private, I move it to X.Internal, at the end ending up with "private" stuff being in X.Internal and "public" stuff being in X, with potentially re-exporting some things from X.Internal if needed. I wonder if there is a significant difference between the two approaches? I guess not?
- I found Internal modules to be crucial for testing, maybe that is also worth mentioning. I don't know any other way to test "private" functions.
from haskell-handbook.
I wonder if there is a significant difference between the two approaches? I guess not?
When separating to public and private modules one issue that can crop up is cyclic dependencies - it's reasonable for public to depend on private, but the other way around is also likely. Especially for things like data type definitions.
from haskell-handbook.
Related Issues (11)
- [New topic] Errors and exceptions HOT 5
- [New topic] Distributing binaries HOT 3
- How to use actual arrays, 1D or 2D, with O(1) access and mutation complexity HOT 3
- [New topic] Mocking IO in unit tests HOT 2
- [New topic] Monad transformers HOT 1
- [New topic] Template Haskell HOT 2
- [New topic] App architecture HOT 1
- [New topic] Development setup HOT 2
- [New topic] Records
- [New topic] Streaming HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haskell-handbook.