dierk / fregegoodness Goto Github PK
View Code? Open in Web Editor NEWSource of the Frege Goodness gitbook
Home Page: http://dierk.gitbooks.io/fregegoodness/
License: Creative Commons Zero v1.0 Universal
Source of the Frege Goodness gitbook
Home Page: http://dierk.gitbooks.io/fregegoodness/
License: Creative Commons Zero v1.0 Universal
we may want to wait for the finalization of the native API but we may also just go ahead with what we have
I found that we have one more chapter titled "More Advanced Polymorphism" (the filename is higher-kinded.adoc
,) nevertheless it have not linked from anywhere. Do you have a plan for publication of this contents?
wait for publication by @vsts
On kindle none part of text is totally black. It's dark grey. That makes reading not as comfortable as it could be.
E. g.
instance Time Int where
sec x = SEC x
minutes x = x.sec * 60
h x = x.sec * 3600
In "Enhancing the DSL for type safety", code sample "The full solution for durations in one go". Else 3.sec + 1.h - 30.minutes == 1803.sec
won’t work.
The chapter contains two function compositions, which use the static function, that is also declared in this chapter.
The static function: static :: Board -> Double
The two usages:
valueTree = static . prunedTree
maxValue = maximize . static . prune 5 . gameTree
The usages are wrong, since static requires a Board (not a Tree of Board) and it returns a Double when maximize requires also a Tree.
The composition is correct in the linked example from the book (example):
evaluateBy :: Ord a => (Board -> a) -> Int -> Board -> a
evaluateBy f lookahead = minimize . fmap f . prune lookahead . gameTree
nowValue :: Int -> Board -> (Double, Board)
nowValue lookahead board = (evaluateBy static lookahead board, board)
Here static is used with fmap, which applies it on the values in the Tree of Board.
So the fixed chapter would contain:
valueTree = fmap static . prunedTree
maxValue = maximize . fmap static . prune 5 . gameTree
but probably also needs some explanation on fmap, when putting it there.
!!
was moved to Data.List
. Proposal to add
import Data.List(!!)
to sample code.
See issue 278
Error in code titled "The definition of a Millimeter type class for an integral type "a"" in section "A mini DSL with type classes/Initial Implementation".
see
https://stackoverflow.com/questions/32959378/how-to-handle-exceptions-in-frege?noredirect=1&lq=1
also delve into exceptions as sum types in the native declarations
https://dierk.gitbooks.io/fregegoodness/content/src/docs/asciidoc/what.html
Instead of
1 / (1 - 1/3 + 2/3) -- Infinity
it should be
1 / (1 - 1/3 - 2/3) -- Infinity
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.