summaryrefslogtreecommitdiff
path: root/doc/todo/type_level_OS_requirements/comment_2_5a1c0c54db25b039eda28e213e1e6263._comment
blob: 27aaf0cd183b955405e05fd7c645eb990307caf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[[!comment format=mdwn
 username="joey"
 subject="""comment 2"""
 date="2016-03-08T18:44:25Z"
 content="""
I've made a typed-os-requirements branch that has type-level
OS lists implemented.

For example:

	*Propellor.Types.OS.TypeLevel> let l = (debian `combineSupportedOS` freeBSD ) `intersectSupportedOS` unixlike
	*Propellor.Types.OS.TypeLevel> l
	OSList [OSDebian,OSFreeBSD]
	*Propellor.Types.OS.TypeLevel> :t l
	l :: OSList
	       (IntersectOSList
	          '[] '['OSDebian, 'OSFreeBSD] '['OSDebian, 'OSBuntish, 'OSFreeBSD])

What this is lacking is type-level equality for OSList.
The complicated type above should be equivilant to `OSList '[OSDebian, OSFreeBSD]`

So, this doesn't type check yet:

	foo :: OSList '[OSDebian, OSFreeBSD]
	foo = (debian `combineSupportedOS` freeBSD ) `intersectSupportedOS` unixlike 

	src/Propellor/Types/OS/Typelevel.hs:47:46:
	    Couldn't match expected type ‘IntersectOSList
	                                    '[]
	                                    '['OSDebian, 'OSFreeBSD]
	                                    '['OSDebian, 'OSBuntish, 'OSFreeBSD]’
	                with actual type ‘'['OSDebian, 'OSFreeBSD]’
	    In the expression:
	      (debian `combineSupportedOS` freeBSD)
	      `intersectSupportedOS` unixlike
	    In an equation for ‘foo’:
	        foo
	          = (debian `combineSupportedOS` freeBSD)
	            `intersectSupportedOS` unixlike

Also, `intersectSupportedOS` should have an additional constraint,
to prevent it from generating an empty type-level list.
"""]]