You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: FFI/README.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,18 @@
5
5
Haskell FFI (Foreign Function Interface) helps calling c functions from haskell and vice versa. You just need to write function signature with appropriate data types (haskell equivalent data types of c).
6
6
7
7
## How to run:
8
-
8
+
```
9
9
$ ghc ffi_examples.hs ffi_examples_c.hs
10
10
$ ./ffi_examples
11
+
```
11
12
12
13
##
13
-
You can never return char* from c function. You must create the string in heap (malloc) and then only you can return the string.
14
+
You can never return char* from c function. You must create the string in heap (malloc) and then only you can return the string.
14
15
15
-
## Upcoming functions
16
+
Alignment is the LCM of all the sizeof of datatypes in the strucutre/Data constructor.
17
+
SizeOf should be the sum of all sizeof of datatypes in the structure includeing the aligment.
Haskell is statically typed, purely functional programming language. Despite being so good, One of the biggest problem, newcomers face while learning haskell is the lack tutorials/documenation. The online learning resource for haskell is quite low, compared with other languages such as Java, Python etc. Hence, I am buiilding repo, containing concept-wise examples, which will new programmers to learn the language as well as experinced haskell programmers can use this as a reference mannual.
4
+
5
+
I will also try to write theory in each section's `README`.
0 commit comments