{"id":"Yp0nhZYYfM4","title":"What are Types in Daml?","description":"📖 Get started with Daml: https://bit.ly/tryDaml\n📚 Learn more about Daml Smart Contracts: https://bit.ly/learn_daml\n📮Check out our blogs: https://bit.ly/daml-blog-engineering\n📋 Become a Daml certified expert: https://bit.ly/daml-certification\n\n#Daml is an open-source smart contract language designed to build composable applications on an abstract ledger model.\n\nDaml is a high level language that focuses on data privacy and authorization of distributed applications. These concepts are represented first class in the language.\n\nBy abstracting data privacy and authorization, DAML takes the burden off the programmer to think about concrete cryptographic primitives and lets her focus on workflow logic.\n\nDaml is a statically typed functional language.\n\nApplications specified in DAML can be deployed on a growing number of platforms including Amazon Aurora , VMWare Concord , R3 Corda , Hyperledger Fabric , Hyperledger Sawtooth , Project DABL and PostgreSQL .\n\nWe will show how to:\nType annotation var : TypeName\nBuiltin types Int, Decimal, Numeric n, Text, Bool, Party, Date, Time\nType synonym type MyInt = Int\nLists type ListOfInts = [Int]\nTuples type MyTuple = (Int, Text)\nPolymorphic types type MyType a b = [(a, b)]\n\n#distributedapplications #smartcontracts","channel_name":"Daml","published_at":"2020-07-17T00:00:00.000Z","thumbnail_url":"https://i.ytimg.com/vi/Yp0nhZYYfM4/hqdefault.jpg","transcript_text":"all right so now i'm going to be going over our second video for the demo cheat sheet this is just briefly going over types uh demo is a strongly typed functional language so if you've ever used one of those before you basically know all this and if you haven't and you're coming from more imperative languages uh there's some nice features that having a strongly typed language give you in particular it gives you the ability to be certain of the data that you're being that are being passed into your contracts uh there's no need to worry about the types of data that are coming in there's no worry that you know an integer is being passed in when you intended to receive a string and all the weird things that can happen then uh depending on your language so in demo they're strictly typed so if a field is supposed to be an integer it's an integer so we have all the basic types integers decimals numerics which are other ways to express some numbers we have text types and bools of course uh all the different dates and time types that you would expect but we also have a party type which is pretty specific to daimle and that is essentially whenever an entity be it a person or an automated service is interacting with the contract uh they would be represented as a party type and that party type confers the ability to do things on a contract that are all specified in your contract code so for example here's some code we have from one of our intro bits of documentation here we have our accountant that is a party to the contract and we can actually specify that they can sign off on the contract and as you can see here with the type definitions we essentially have a requirement that you know all signatories be parties and can't be any sort of other type of data and parties themselves have you know the ability to either to construct transactions and if they if parties are specified on a contract but have not actually done anything to say that i agree to this contract um like they can't be given any obligations on a contract you can put the owner here as a signatory and not get their signature right now it's just the accountants so the accounts and so you need to instantiate this contract but that's a really nice feature of the party type is that it enforces these things and you know those are just the basics obviously everything works out exactly as you would think we can't have one party be the same as the other we can have a variety of numbers we can prove equivalency between them as we would expect same for dates and and times and strings and all that fun stuff uh and then of course you know we have our list types where we can have a variety of different lists that you know are constructed in pretty much the way that you would expect this this particular syntax might look a little weird to you again if you're coming from a more imperative programming background but this is actually fairly common syntax in functional languages uh it actually probably is identical to haskell in this case and yeah so those are the just a brief overview of the types that are available in demo and of course we also have you know tuples as you would expect and we have polymorphic types where you can specify one type that is constructed out of other types and that's really interesting so for example here uh my type a b could be like my type string string is a and integer is b and that would actually end up being represented as a list of tuples and so that's actually a really powerful programming construct but probably beyond the scopes of this video and yeah those are devil types thank you","transcript_synced_at":"2026-10-26T04:14:55.232Z","segments":[{"start_seconds":1,"text":"all right so now i'm going to be going over our second video for the demo cheat sheet this is just briefly going over types","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=1s"},{"start_seconds":10,"text":"uh demo is a strongly typed functional language so if you've ever used one of those before you basically know all this and if you haven't and you're coming","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=10s"},{"start_seconds":19,"text":"from more imperative languages uh there's some nice features that having a strongly typed language give you in particular it gives you the ability to","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=19s"},{"start_seconds":28,"text":"be certain of the data that you're being that are being passed into your contracts uh there's no need to worry","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=28s"},{"start_seconds":35,"text":"about the types of data that are coming in there's no worry that you know an integer is being passed in when you","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=35s"},{"start_seconds":42,"text":"intended to receive a string and all the weird things that can happen then uh depending on your language so in demo they're strictly typed so if","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=42s"},{"start_seconds":51,"text":"a field is supposed to be an integer it's an integer so we have all the basic types integers decimals numerics which are other ways to express","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=51s"},{"start_seconds":59,"text":"some numbers we have text types and bools of course uh all the different dates and time types that you would expect but we also have","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=59s"},{"start_seconds":66,"text":"a party type which is pretty specific to daimle and that is essentially whenever an entity be it a person or an","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=66s"},{"start_seconds":75,"text":"automated service is interacting with the contract uh they would be represented as a party type and that party type","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=75s"},{"start_seconds":83,"text":"confers the ability to do things on a contract that are all specified in your contract code so for example here's some","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=83s"},{"start_seconds":91,"text":"code we have from one of our intro bits of documentation here we have our accountant that is a party to the","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=91s"},{"start_seconds":99,"text":"contract and we can actually specify that they can sign off on the contract and as you can see here with the type","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=99s"},{"start_seconds":108,"text":"definitions we essentially have a requirement that you know all signatories be parties and can't be any sort of other type of data","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=108s"},{"start_seconds":117,"text":"and parties themselves have you know the ability to either to construct transactions","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=117s"},{"start_seconds":124,"text":"and if they if parties are specified on a contract but have not actually done","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=124s"},{"start_seconds":131,"text":"anything to say that i agree to this contract um like they can't be given any obligations on a contract you can put the owner here as a","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=131s"},{"start_seconds":140,"text":"signatory and not get their signature right now it's just the accountants so the accounts and so you need to instantiate this contract but","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=140s"},{"start_seconds":147,"text":"that's a really nice feature of the party type is that it enforces these things and you know those are just the basics obviously everything","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=147s"},{"start_seconds":156,"text":"works out exactly as you would think we can't have one party be the same as the other we can have a variety of numbers we can","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=156s"},{"start_seconds":165,"text":"prove equivalency between them as we would expect same for dates and and times and strings and all that fun stuff uh and then of course you know we have","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=165s"},{"start_seconds":173,"text":"our list types where we can have a variety of different lists that you know are constructed in pretty much","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=173s"},{"start_seconds":180,"text":"the way that you would expect this this particular syntax might look a little weird to you again if you're coming from a more imperative programming background","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=180s"},{"start_seconds":190,"text":"but this is actually fairly common syntax in functional languages uh it actually probably is identical to haskell in this case and","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=190s"},{"start_seconds":198,"text":"yeah so those are the just a brief overview of the types that are available in demo and of course we also have you","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=198s"},{"start_seconds":208,"text":"know tuples as you would expect and we have polymorphic types where you can specify one type that is constructed out of","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=208s"},{"start_seconds":216,"text":"other types and that's really interesting so for example here uh my type a b could be like my type","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=216s"},{"start_seconds":222,"text":"string string is a and integer is b and that would actually end up being represented as a","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=222s"},{"start_seconds":230,"text":"list of tuples and so that's actually a really powerful programming construct but probably beyond the scopes of this video","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=230s"},{"start_seconds":238,"text":"and yeah those are devil types thank you","url":"https://www.youtube.com/watch?v=Yp0nhZYYfM4&t=238s"}],"youtube_url":"https://youtube.com/watch?v=Yp0nhZYYfM4","url":"https://ccpedia.xyz/videos/Yp0nhZYYfM4"}