Parallel & Concurrent Haskell (2)

Continued from : (Part 1)

2.2 Data Structure

Function (+) ::  D -> D -> D
inc  x  = 1 + x ~ (+) ::  1 + x

Section (Partial appl) : inc  = (+ 1)

Type ~ Set {values} : Integer Set / Boolean Set {0,1} / Empty Set “Void” { } / …

Type of Singleton (1 element) : Unit ( )

Declare a new Type : data

data () = ()
1st () = Type of Unit
2nd () = constructor of Unit

Haskell convention : Type name = constructor name

(To avoid having too many nsmes)

Define cares Ian product of Types (Sets):

data Product a b = P a b

Product : Type constructor
P : Data constructor (function with 2 args of types a, b)
P :: a -> b -> Product a b

Data Immutable : remember how it was constructed.

(+) :: Num a => a -> a -> a 

sqDist ‘ ‘ (P x y ) = x^2 + y^2
sqDist ‘ ‘ :: Num a =-> Product a a -> a

Built-in for “pair”:

data ( , ) a b =( , ) a b

eg.
( , ) 1 2 gives (1, 2)

All data (Types) are formed by only 2 methods : Product or Sum.

\boxed {\text {Algebraic Data : by Product, Sum}}

Parallel and Concurrent Haskell: http://www.youtube.com/playlist?list=PLbgaMIhjbmEm_51-HWv9BQUXcmHYtl4sw

<b>Read Free Online Book:</b>
http://chimera.labs.oreilly.com/books/1230000000929/index.html
<a href=”https://tomcircle.files.wordpress.com/2017/07/20170712_200456.png”><img src=”https://tomcircle.files.wordpress.com/2017/07/20170712_200456.png&#8221; alt=”” class=”wp-image-13955 alignnone size-full” width=”1064″ height=”1262″></a>

Guide to Starting Javaplex (With Matlab)

Persistent Homology Tool

Singapore Maths Tuition

Guide to Starting Javaplex (With Matlab)

Step 1)

Visit https://appliedtopology.github.io/javaplex/ and download the Persistent Homology and Topological Data Analysis Library

2)

Download the tutorial at http://www.math.colostate.edu/~adams/research/javaplex_tutorial.pdf and jump to section 1.3. Installation for Matlab.

3)

In Matlab, change Matlab’s “Current Folder” to the directory matlab examples that you just extracted from the zip file.

(See https://www.mathworks.com/help/matlab/ref/cd.html to change current folder)

Type this in Matlab: cd /…/matlab_examples

Where … depends on where you put the folder

4) In the tutorial (from the link given in step 2), proceed to follow the instructions starting from “In Matlab, change Matlab’s “Current Folder” to the directory matlab examples that you just extracted from the zip file. In the Matlab command window, run the load javaplex.m file.”.

5) Test: Run example 3.2 (House example) by typing in the code (following the tutorial)

View original post