1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[9972],{3905:(e,n,t)=>{t.d(n,{Zo:()=>s,kt:()=>m});var r=t(67294);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){o(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function l(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var u=r.createContext({}),c=function(e){var n=r.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},s=function(e){var n=c(e.components);return r.createElement(u.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},p=r.forwardRef((function(e,n){var t=e.components,o=e.mdxType,i=e.originalType,u=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=c(t),m=o,f=p["".concat(u,".").concat(m)]||p[m]||d[m]||i;return t?r.createElement(f,a(a({ref:n},s),{},{components:t})):r.createElement(f,a({ref:n},s))}));function m(e,n){var t=arguments,o=n&&n.mdxType;if("string"==typeof e||o){var i=t.length,a=new Array(i);a[0]=p;var l={};for(var u in n)hasOwnProperty.call(n,u)&&(l[u]=n[u]);l.originalType=e,l.mdxType="string"==typeof e?e:o,a[1]=l;for(var c=2;c<i;c++)a[c]=t[c];return r.createElement.apply(null,a)}return r.createElement.apply(null,t)}p.displayName="MDXCreateElement"},48720:(e,n,t)=>{t.d(n,{D:()=>o.Z,Z:()=>i});var r=t(67294),o=t(75402);const i=function(e){return r.createElement(o.Z.Consumer,null,(n=>{let{syntax:t}=n;return t===e.syntax?e.children:r.createElement(r.Fragment,null)}))}},45064:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>l,default:()=>p,frontMatter:()=>a,metadata:()=>u,toc:()=>s});var r=t(87462),o=(t(67294),t(3905)),i=t(48720);const a={id:"including",title:"Including"},l=void 0,u={unversionedId:"modules/including",id:"version-1.6.0/modules/including",title:"Including",description:"When writing a new version of a module, it is often needed to add new",source:"@site/versioned_docs/version-1.6.0/modules/including.md",sourceDirName:"modules",slug:"/modules/including",permalink:"/docs/1.6.0/modules/including",draft:!1,tags:[],version:"1.6.0",frontMatter:{id:"including",title:"Including"},sidebar:"docs",previous:{title:"Importing",permalink:"/docs/1.6.0/modules/importing"},next:{title:"Declaring",permalink:"/docs/1.6.0/signatures/declaring"}},c={},s=[],d={toc:s};function p(e){let{components:n,...t}=e;return(0,o.kt)("wrapper",(0,r.Z)({},d,t,{components:n,mdxType:"MDXLayout"}),(0,o.kt)(i.Z,{syntax:"cameligo",mdxType:"Syntax"},(0,o.kt)("p",null,"When writing a new version of a module, it is often needed to add new\nfeatures, that is, new types and values, for example when implementing\nthe next version of a standard. This can be achieved by defining a new\nmodule that includes the types and values of the old one, and defines\nnew ones."),(0,o.kt)("p",null,"In the following example, let us extend the ",(0,o.kt)("inlineCode",{parentName:"p"},"Euro")," module with a 10\neuro note. The inclusion of a module ",(0,o.kt)("inlineCode",{parentName:"p"},"M")," is specified with a field\n",(0,o.kt)("inlineCode",{parentName:"p"},"include M"),", like so:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-cameligo",metastring:"group=including",group:"including"},"module Euro =\n struct\n type t = nat\n let add (a, b : t * t) : t = a + b\n let one : t = 1n\n let two : t = 2n\n end\n\nmodule NewEuro =\n struct\n include Euro\n let ten : t = 10n\n end\n"))),(0,o.kt)(i.Z,{syntax:"jsligo",mdxType:"Syntax"},"This feature is not available in JsLIGO."))}p.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.