File: FixInt.curry

package info (click to toggle)
curry-tools 1.0.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,492 kB
  • ctags: 121
  • sloc: makefile: 470; sh: 421
file content (13 lines) | stat: -rw-r--r-- 312 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
{-# OPTIONS_CYMAKE -F --pgmF=currypp --optF=defaultrules #-}

import Test.EasyCheck

-- Operation to delete suffixes of the fornm ".0"
fix_int (s++".0") = s
fix_int'default s = s

main = map fix_int ["1.3","1.0","42"]

test1 = fix_int "1.3" -=- "1.3"
test2 = fix_int "1.0" -=- "1"
test3 = fix_int "42"  -=- "42"