This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(+) :: Int -> Int -> Int | |
(I# a) + (I# b) = I# (a +# b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g :: Int | |
g = f_Just (Just 5) | |
h :: Int | |
h = f_Nothing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f_Just :: Maybe Int -> Int | |
f_Just (Just a) = a | |
f_Nothing :: Int | |
f_Nothing = 0 | |
f :: Maybe Int -> Int | |
f x = case x of | |
Just a -> f_Just a | |
Nothing -> f_Nothing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f :: Maybe Int -> Int | |
f x = case x of | |
Just a -> a | |
Nothing -> 0 | |
g :: Int | |
g = f (Just 5) | |
h :: Int | |
h = f Nothing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.LCPI1_0: | |
.quad 4633260719236591239 # double 57.29746936176985 | |
torad2(double): | |
mulsd .LCPI1_0(%rip), %xmm0 | |
ret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PI (3.1415) | |
double torad2(double n) { | |
return 180 / PI * n; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.LCPI0_0: | |
.quad 4640537203540230144 # double 180 | |
.LCPI0_1: | |
.quad 4614256447914709615 # double 3.1415 | |
torad1(double): | |
mulsd .LCPI0_0(%rip), %xmm0 | |
divsd .LCPI0_1(%rip), %xmm0 | |
ret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PI (3.1415) | |
double torad1(double n) { | |
return n * 180 / PI; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
important_t *counting = NULL; | |
safelyPrintImportant(counting); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
safelyPrintImportant(NULL); | |
// warning: warning: null passed to a callee which requires a non-null argument [-Wnonnull] |